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

 
You have to sleep at night.
 
Aleksey Vyazmikin #:

On the new data, yes. It's just that a stable pattern has been hit, and the rest of the tree leaves only wind noise. The noise is there from forcing the tree to give answers to all questions, i.e. to classify the whole sample.

I do it (selection of leaves) on automatic - by changing the leaf activation level. Classically, 0.5 is used for classification. All leaves with a probability higher than 0.5 are activated, the rest are silent (which is tantamount to their removal from the tree). This method has been described in more than one article on this site and forum.

And you can set the level to 0.9 or 0.95, then only super clean leaves with 95% of examples of the correct class will work. For regression similarly, only the level is not from 0 to 1, but in abs values. The pictures above show the same model, but with different activation levels. The first one through 0.00020, the second through 0.00040pts. The second one skipped unprofitable trading intervals, and worked only on the most profitable ones and showed profit, although it worked with pauses of 1-2 years. The activation was in 70000 cases out of 400000, i.e. about 17% of the best leaves worked.

The result is similar, achieved with just one command in the code if(leaf_value>0.00040){...}. , without all the fiddling you do with selecting leaves, and now clusters as well.

But you already know all that....

 
Aleksey Vyazmikin #:

On the new data, yes. It's just that a consistent pattern has been hit, and the rest of the tree leaves only wind noise. The noise is there from forcing the tree to give answers to all questions, i.e. to classify the whole sample.

The problem is that the tree is built not by the condition of profit maximisation, but by a loss function convenient for programming the package.

So you have to make an unpleasant choice - either try to reconfigure a complex, tricked-out package or build a cramped bicycle. It is also possible to "successfully" combine both of these options).

IMHO, if you choose to fiddle with an existing package on trees, you should try to use pruning (pruning) - with the condition of profit maximisation on the forward, for example. It might be possible to avoid manual fiddling with the rules.

 
Maxim Dmitrievsky #:
I don't hold out much hope, just peeking in every now and then. After all gpt I predict stagnation and stagnation in this topic. No breakthroughs are visible. It's purely a hype flash, like with crypto. Now they will make money and calm down.
I'm with you!

My whole neighbourhood praises propagandized neural networks, but when you set them simple tasks, they do not cope with them
 
Stanislav Korotky #:

The example I gave is just from the section of categorical cross-entropy (and you probably didn't pay attention to the fact that the sum of values there is 1 in each instance). The fact that it does not work as in Keras is an indicator for me, which means that either the implementation or the description of CCE in MQL5 does not match the expected. Then a detailed description is required. By the way, in pytorch CrossEntropyLoss includes a preliminary softmax inside. But in general, since the documentation on matrices in MQL5 contains the idea that the interface is similar to the python one, the coincidence of behaviour is implied. And if there is no coincidence, it causes problems and perplexity.

Having many classes implies working with matrices (when we have a bunch of samples/rows, each of which has classes), so your example with a vector still does not answer the question.

I get it. Loss functions work with matrices as they do with vectors. In this place we didn't finish (we didn't add the axis parameter)

That is, in your example we need to solve it line by line.

Thank you for your attention

 
Aleksey Vyazmikin #:

On the new data, yes. It's just that a consistent pattern has been hit, and the rest of the tree leaves only wind noise. The noise is there from forcing the tree to give answers to all questions, i.e. to classify the whole sample.

and if you take it out of the forest, there will be an average of the rules of all trees there, by the number of trees

 
Forester #:

I do this (leaf selection) automatically by changing the leaf activation level. Classically, 0.5 is used for classification. All leaves with a probability higher than 0.5 are activated, the rest are silent (which is tantamount to removing them from the tree). This method has been described in more than one article on this site and on the forum.

And you can set the level to 0.9 or 0.95, then only super clean leaves with 95% of examples of the correct class will work. For regression similarly, only the level is not from 0 to 1, but in abs values. The pictures above show the same model, but with different activation levels. The first one through 0.00020, the second through 0.00040pts. The second one skipped unprofitable trading intervals, and worked only on the most profitable ones and showed profit, although it worked with pauses of 1-2 years. The activation was in 70000 cases out of 400000, i.e. about 17% of the best leaves worked.

The result is similar, achieved with just one command in the code if(leaf_value>0.00040){...}. without all the fiddling you do with selecting leaves and now clusters.

But you already know all that....

You have a forest, don't you reweight the model after building it? Or do you just take the average of the activated leaves?

That's the thing, when selecting a leaf I take into account stability and uniformity of response distribution over history. I make two-dimensional indicators and evaluate them in aggregate. Thus, leaves without responses are extremely rare for me.

It seems to me that you could easily save leaves, creating thousands of trees, and work with them only.

 
Aleksey Nikolayev #:

The problem is that the tree is not built according to a profit maximisation condition, but according to a loss function convenient for package programming.

So you have an unpleasant choice - either try to reconfigure a complex, tricky package, or build a cramped bicycle. It is also possible to "successfully" combine both of these options)

IMHO, if you choose to fiddle with an existing package on trees, you should try to use pruning (pruning) - with the condition of profit maximisation on the forward, for example. It might be possible to avoid manual fiddling with the rules.

The variant I used for building the tree builds not deep trees - pruning may be unnecessary there.

Yes, almost all fiddling is automated, and what is not is based on my ignorance of R rather.

I'm talking about noise, because the root predictor may contain probability of predisposition to specific classes in the region of 10% or less, and the rest of the probability is evenly distributed, and the rest of the residue is used to cut the remaining leaves.

 
Maxim Dmitrievsky #:

and if you pull it out of the woods, there'll be an average of all the trees, by the number of trees

The trees are independently built, and then weighted by the answers in the leaves. I didn't work with a forest, but with a single tree. I've never heard of a forest on genetics.

 
Aleksey Vyazmikin #:

Trees, on the other hand, are independently built, and then the answers are weighed in the leaves. I have not worked with a forest, but with a single tree. I've never heard of a forest on genetics.

Oh, right, there's no point in using Forest then.

and what is the difference between a genetic tree and a regular tree, what are the advantages?

Reason: