Machine learning in trading: theory, models, practice and algo-trading - page 100

 
Mihail Marchukajtes:
You are absolutely right at the beginning. Finally some sensible people appeared in the branch. Yes, the classification evaluates a pattern in terms of truth or falsehood, or says I don't know, as Reshetov suggested. And if this reaction is identical to the one in training, the network will make a correct conclusion. So it's like this....
What to do? Try to use the naive Bayesian classifier or study the j-predictors?
 
Yuri Evseenkov:
What should I do? Try to pull the naive Besovian classifier, or study gPredictors?
xWhat is the Besovian classifier???? I do not understand, now Reshetov made a terribly cool thing, on the principle of on, off, dough. And you keep messing around with your R. Doing a bunch of unnecessary data manipulation. And what's the iris example???? Interesting to see how the Predictor will figure it out....
 
Mihail Marchukajtes:
xWhat's the Besov Classifier???? I don't get it, now Reshetov has made a terribly cool thing, on, off, dough. And you're still messing around with your R. Doing a bunch of unnecessary data manipulation. And what's the example with iris???? Interesting to see how the Predictor will figure it out....
I only found out about R here. And in the word Bayesian classifier accidentally missed a letter (maybe by Freud). And that Reshetov's program is cool, I don't argue. I don't know about iris.
 
Yuri Evseenkov:
I only found out about R here. And in the word Bayesian classifier I accidentally missed a letter (maybe by Freud). And that Reshetov's program is cool, I don't argue. I don't know about iris.
IShaitan Reshetov's machine :-)
 
Mihail Marchukajtes:
xWhat is the Besov classifier???? I do not understand, now Reshetov has made a terribly cool thing, on the principle of on, off, dough. And you guys keep messing around with your R's. Doing a bunch of unnecessary data manipulation. And what's the iris example???? Interesting to see how the Predictor will figure it out....

Can you see the results of yesterday's trading?

 
Mihail Marchukajtes:
IShaitan Reshetov's car :-)
Can we delete the posts starting with my typo?
 
mytarmailS:

Why have indicators never worked and never will work? My opinion...

did anyone try anything? any thoughts? or it was not even clear what we were talking about?
 
2 Dr.Trader.

Hi.

Yes, I have tried to put together a committee.

I have 1,000 trained models. There is a deferred sample of 5 years. I asked my colleague for advice on how to assemble committees. He advised me to assemble the committee on one part of the deferred sample and test it on the other part. That's where I faltered. The committee retrained for the first part and showed a plum on the second part.

It's the same story with individual models. I make the mistake of selecting a model by delayed sampling. After that, the model can easily merge.
 

You know and have done much of this yourself, but I will write more fully to exclude some assumptions that we talk about in the same way, but do differently.

You have to have a carefully honed fitness function to estimate model parameters. If the function evaluates specific model parameters and selected predictors with a high score - then there should be good results in the test on the new data.
(I will keep in mind for any estimation that the higher it is, the better)

For example you have data for training, 5 years. And the parameters for gbm are n.trees, interaction.depth, shrinkage, n.minobsinnode, distribution, bag.fraction.

The fitness function in the loop should repeat at least 50 times:
1) divide the data into 2 parts, 50%/50%. There should be both random sampling with sample and sequential sampling (the piece for training somewhere in the middle, and for validation, what surrounds it at the beginning and end of the raw data). Including extreme variants, where training on the first half of the table, and validation on the last, and vice versa. I believe that for training it is important to have both sequentially selected samples, and random. In the picture you can see more clearly some examples of random and sequential partitioning, the green lines are for training, the yellow ones are for validation.


2) train the model on the training sample (model parameters and predictors used are the same throughout the cycle, the ones you are trying to estimate), then forecast these same data by this model, and rate the prediction - accuracy, r^2, or something else. For example, I round the regression result to classes, and use Cohen's Kappa function for estimation, it's from caret, I liked it better than classification accuracy or regression accuracy. But it only works for two classes. For three classes I find it difficult to suggest anything, the important thing is that the estimate takes into account the accuracy for each class separately, and gives some overall estimate based on that.
3) Apply the trained model to predict data from the validation sample, estimate the prediction with the same function.
4) Both estimates (training and validation) should be close to each other, and as high as possible. I use this code for final score - (min(score1,score2) - (max(score1,score2)-min(score1,score2)) - Their delta is subtracted from the minimum value.

At the end of each iteration we will get some score, and due to random splitting of data it may vary from -1 to 1 (or in another interval, depending on the function used). We calculate their average value, and return it as a result of the fitness function. Additionally, I subtract a small number (0.0001) from the fitness value for each predictor used, to penalize the model for too large a set of required data.

I apply this together with genetics, which picks up predictors and model parameters, maximizing fitness value.

The end result is a set of predictors, and model parameters that, on average, have good prediction results on the available training data. The model can find some patterns in the data, learn from them, and still successfully find those same patterns in the new validation data, whichever sample of data is used for training.
Since the model was trained each time using only 50% of the available data, and the parameters and predictors were chosen based on this, this is an important condition for the model.
The model for the committee should be trained under the same conditions - either by sampling or by consistently selecting 50% of the data for training. For each new model the sample (or sequential set) needs a new one too.

How long will such committee give good forecasts is unknown, but considering that the data for training were for 5 years, the committee will obviously live less than the next 5 years.
And one more important point - if after all time spent for creation of the committee it will be loss-making trading - then the package used for forecasts is not suitable for forex. Maybe it has too many degrees of freedom, or just is not suitable. It is better to take another package. Or you can try to reduce the percentage of data for training from 50% to even less.

All this from advice from this forum, and experience.

 
Dr.Trader:

You know and have done much of this yourself, but I will write more fully to exclude some assumptions that we talk about in the same way but do differently.

You need to have a carefully honed fitness function to estimate model parameters. If the function evaluates specific model parameters and selected predictors with a high score - there should be good results in the test on the new data.
(I will keep in mind for any estimation that the higher it is, the better)

For example you have data for training, 5 years. And the parameters for gbm are n.trees, interaction.depth, shrinkage, n.minobsinnode, distribution, bag.fraction.

The fitness function in the loop should repeat at least 50 times:
1) divide the data into 2 parts, 50%/50%. There should be both random sampling with sample and sequential sampling (the piece for training somewhere in the middle, and for validation, what surrounds it at the beginning and end of the raw data). Including extreme variants, where training on the first half of the table, and validation on the last, and vice versa. I believe that for training it is important to have both sequentially selected samples, and random. In the picture you can see more clearly some examples of random and sequential partitioning, the green lines are for training, the yellow ones are for validation.


2) train the model on the training sample (model parameters and predictors used are the same throughout the cycle, the ones you are trying to estimate), then forecast these same data by this model, and rate the prediction - accuracy, r^2, or something else. For example, I round the regression result to classes, and use Cohen's Kappa function for estimation, it's from caret, I liked it better than classification accuracy or regression accuracy. But it only works for two classes. For three classes I find it difficult to suggest anything, the important thing is that the estimate takes into account the accuracy for each class separately, and gives some overall estimate based on that.
3) Apply the trained model to predict data from the validation sample, estimate the prediction with the same function.
4) Both estimates (training and validation) should be close to each other, and as high as possible. I use this code for final score - (min(score1,score2) - (max(score1,score2)-min(score1,score2)) - Their delta is subtracted from the minimum value.

At the end of each iteration we will get some score, and due to random splitting of data it may vary from -1 to 1 (or in another interval, depending on the function used). We calculate their average value, and return it as a result of the fitness function. Additionally, I subtract a small number (0.0001) from the fitness value for each predictor used, to penalize the model for too large a set of required data.

I apply this together with genetics, which picks up predictors and model parameters, maximizing fitness value.

The end result is a set of predictors, and model parameters that, on average, have good prediction results on the available training data. The model can find some patterns in the data, learn from them, and still successfully find those same patterns in the new validation data, whichever sample of data is used for training.
Since the model was trained each time using only 50% of the available data, and the parameters and predictors were chosen based on this, this is an important condition for the model.
The model for the committee should be trained under the same conditions - either by sampling or by consistently selecting 50% of the data for training. For each new model the sample (or sequential set) needs a new one too.

How long will such committee give good forecasts is unknown, but considering that training data was for 5 years, the committee will obviously live less than the next 5 years.
And one more important point - if after all time spent for creation of the committee it will be loss-making trading - then the package used for forecasts is not suitable for forex. Maybe it has too many degrees of freedom, or just is not suitable. It is better to take another package. Or you can try to decrease data percentage for training from 50% to even less.

All this from advice from this forum, and experience.

Excellent summation.

Congratulations!

Reason: