Coder Social home page Coder Social logo

Comments (2)

MehranTaghian avatar MehranTaghian commented on June 9, 2024

from dqn-trading.

dekacypher avatar dekacypher commented on June 9, 2024

Remove EPS and n_actions from the DeepRL constructor, because they don't match the parameteres of the constructor of DeepRL, and also set data_train to the correct type it should be DataAutoPatternExtractionAgent and not DataForPatternBasedAgent. And likewise for the test() method, the parametres used doesn't match the constructor of the test()-method.

Like this:

`
deepRLAgent = DeepRL(data_loader, dataTrain_autoPatternExtractionAgent_windowed, dataTest_autoPatternExtractionAgent_windowed, DATASET_NAME,
state_mode, window_size, transaction_cost,
BATCH_SIZE=BATCH_SIZE, GAMMA=GAMMA, ReplayMemorySize=ReplayMemorySize,
TARGET_UPDATE=TARGET_UPDATE, n_step=n_step)
#EPS=EPS,
#n_actions=n_actions,
deepRLAgent.train(n_episodes)
file_name = None

ev_deepRLAgent = deepRLAgent.test(
initial_investment=initial_investment, test_type='train')
#file_name=file_name, action_name=dataTrain_autoPatternExtractionAgent_windowed.action_name,
deepRLAgent_portfolio_train = ev_deepRLAgent.get_daily_portfolio_value()
ev_deepRLAgent = deepRLAgent.test(
initial_investment=initial_investment, test_type='test')
#file_name=file_name, action_name=dataTrain_autoPatternExtractionAgent_windowed.action_name,
deepRLAgent_portfolio_test = ev_deepRLAgent.get_daily_portfolio_value()

model_kind = 'DQN-pattern'

add_train_portfo(model_kind, deepRLAgent_portfolio_train)
add_test_portfo(model_kind, deepRLAgent_portfolio_test)
``

from dqn-trading.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.