Skip to content

Latest commit

 

History

History
78 lines (55 loc) · 3.29 KB

README_agent_deep.md

File metadata and controls

78 lines (55 loc) · 3.29 KB

Agent: AgentDeep

Agent for an OpenAI Gym environment, implementing a Keras model as feature extractor.

Build Status Documentation Status BCH compliance license

Description

This agent loads an standardized observation dataset on a gym environment, reads observations from it and executes actions based on the output of a Keras model used as feature extractor, and a neat-python pre-optimized neural network used as action controller.

Exports a csv containing the agent state (balance, equity, orders status) and the trading history.

The agent is implemented in the AgentDeep class, it has methods for loading a dataset on a simulation environment, performing steps of the simulation and d it and producing an output dataset and a configuration file that can be loaded and applied to another dataset, please see test_agent_deep. It can also be used via command line.

Installation

The module is installed with the preprocessor package, the instructions are described in the following section.

Steps

  1. Clone the GithHub repo:

git clone https://github.com/harveybc/preprocessor

  1. Change to the repo folder:

cd preprocessor

  1. Install requirements.

pip install -r requirements.txt

  1. Install python package (also installs the console command data-trimmer)

python setup.py install

  1. (Optional) Perform tests

python setup.py install

  1. (Optional) Generate Sphinx Documentation

python setup.py docs

Command-Line Execution

The standardizer also is implemented as a console command:

standardizer -- input_file <input_dataset> <optional_parameters>

Command-Line Parameters

  • --input_file : The only mandatory parameter, is the filename for the input dataset to be trimmed.
  • --output_file : (Optional) Filename for the output dataset. Defaults to the input dataset with the .output extension.
  • --output_config_file : (Optional) Filename for the output configuration containing rows trimmed in columns 0 and columns trimmed in column 1. Defaults to the input dataset with the .config extension.
  • --input_config_file : (Optional) Imports an existing configuration and trims a dataset with it.

Examples of usage

The following examples show both the class method and command line uses.

Usage via Class Methods

from preprocessor.standardizer.standardizer import Standardizer
# configure parameters (same vaiable names as command-line parameters)
class Conf:
    def __init__(self):
        self.input_file = "tests/data/test_input.csv"
conf = Conf()
# instance trimmer class and loads dataset
st = Standardizer(conf)
# do the trimming
st.standardize()
# save output to output file
st.store()

Usage via CLI

standardizer --input_file "tests/data/test_input.csv"