Closed munkh-erdene closed 5 years ago
Which agent? I am really not suggest you to predict on different stock market, results may be not really good, unless you trained the agent on different stock market, so at least it will learn some stock market samples.
Just use pickle, let say I want to reuse this agent, evolution-strategy-agent.ipynb,
I assumed you already run this,
model = Model(window_size, 500, 3)
agent = Agent(model,10000,5,5)
agent.fit(500, 10)
Now you want to save,
import pickle
with open('my-agent.pkl', 'wb') as fopen:
pickle.dump(agent, fopen)
Now you want to load,
import pickle
with open('my-agent.pkl', 'rb') as fopen:
agent = pickle.load(fopen)
agent.buy()
You need to tweak some code inside agent.buy
to accept dynamic timeseries data. Should not very hard to do it.
Thank you. I'm trying to train "evolution-strategy-bayesian-agent" model to predict Crude oil's price will go UP or DOWN.
I just need to predict one step ahead Crude oil' price will go UP or DOWN.
this agent cannot predicts a trend, it predicts decision to buy or sell based on a trend. you should forecast using ARIMA or deep learning models i provided in this repository.
Yeah i know. This Agent's decision is equal to prediction right? BUY decision = UP, SELL decision = DOWN.
is there a possibility to continously feed data to the agent and get the decicion? or would one need to retrain with new data in the csv?
First of all thank you for sharing your code. Its interesting. I have a question how do i save a Trained agent and reuse it?