Hy Quantisti,
i have write a system of Machine learning that use the random forest, in vectorized code.
When i try to transform in event driven,
how and where, in the event driven format code, can i recall the system based on ML write in vectorized code?
could you share a screeshoot for example?
many thanks for the help.!
i have already watched the course "buy and hold strategy " section 11 where you explain the transformation, but i don't how can i recall in event drive format the machine learning previsional sistem.
the machine learning system with random walk it's from ernest p. course from quantra quantisti.
Hello Irene, Can you please provide the following details to answer this query better?
- Are you using ML for classification or regression? and how are the signals generated once the model is fit?
- Can you also provide me with the link to the course unit you are referring to?
- A sample of your code would also help me to guide you better for conversion to an event-driven backtester.
hi and thanks for the answer and the next one answer i supposed will be.
i am using a ml model classification (through random forest classifier).
the signal is generated by multiple indicators or oscillators (y and x target and features).
i have start to write my code from the course phyton for machine learning resource.
and the signal is generated by the predicted variable...exactly like in the visual code through the course
"ML CLASSIFICATION MODEL TRAINING AND FORECASTING".
Don't worry if my model is different...but please show me a model of event drive of code through ML application forecasting.
#prediction for tomorrow price data['future_returns']=data['Close'].pct_change().shift(-1)
#creation signal column
data[‘signal’]=np.where(data[‘future_returns’]>0,1,0)
#print signal and closing price tail
data[[‘Close’,‘signal’]].tail()
This is for example the course to realize in blueshift, i am not able.
neural network in python.
could you help me?
Hello Irene this is in response to your query on event-based backtester for your ML model,
For an event-based backtester, you need to loop through all data points in the dataset one at a time, irrespective of the ML model you are using, you can train the model in every iteration with updated data and take signals as per the prediction.
However, before taking the signal, you can also check the model performance in each iteration and take position only when the model performance is good as per the metrics you choose such as accuracy, precision, recall, F1 score etc.
However, training the model in every iteration is not an optimum way to approach this since it takes time and resources for model training. Therefore, you could instead choose to retrain the model at periodic intervals, such as once a month or once a quarter.
You can refer to this section for more details on code structure. You can also refer to this unit for a reference code.
I hope this helps!
Hi Irene,
You can refer to the code in this section to get an idea about writing the code in an event-driven format. After going through the steps, you can try doing the same on Blueshift by following similar steps. Please do let us know if you face any issues.
Thanks,
Akshay