Algorithm for combining ranges of a segment - help to create - page 7

 
Aleksey Nikolayev:

The question is off-topic and rather philosophical. Is it realised that the approach to classification by dividing attributes into segments implies a discontinuous dependence of outputs on inputs? That is, a situation may arise when a trade will open at one set of attributes and will not open at another very, very close to the first (they are near the boundary, but on opposite sides of it). I'm not saying it's the wrong approach. I just want to ask - is there some kind of trader's intuition behind it or is it an arbitrary choice?

Yes, it is possible, in theory. However, the method of binning implies building a set of consecutive trees on different predictors, which means that the right boundary can be selected for another trait (if there is statistical justification), thus the "error" is leveled.

Aleksey Nikolayev:

As a possible alternative, classification by means of logistic regression or the nearest-neighbour method can be proposed. There, the output can be an estimate of the probability of belonging to a class, which can, for example, be used to determine the volume of the transaction. I don't insist on any particular algorithms, just interested in the trader's aspect of choosing a specific MO algorithm.

CatBoost also gives an estimate of class membership probability, but by my observation it is exactly the opposite - greater confidence in rare observations that do not occur often enough and this leads to their overestimation, and on an independent sample this will either lead to misclassification or even more rare occurrence of a high index.

Why I use CatBoost for trading:

1. fast algorithm.

2. A modern and evolving algorithm with many advances in MO out of the box.

3. A standalone way to apply the model in MT5 without Python and R.

 
Aleksey Vyazmikin:

The question here is how to identify "many valuable sections and toxic ones" - i.e. you need to identify their interchangeability, or do it in two passes, as I suggested earlier. Or do you have another option?

I know of a way to do it only in two passes. First we make a map, then we choose a path. Straight away, without a map you can also go, but it is much bigger risks, especially when ravines and swamps on the way, and a compass, stars and sun).

The question is the cost of action and the availability of initial data. Apparently you have to set the goal from here. Conditions may be different. We know the number of points and segments. We do not know the number of segments, but we know the number of points, we do not know the number of points and segments, we only know that they are quite a lot. We know that the number of segments from a point is at most N.

In general, this part has to be formalized first.

 
Aleksey Vyazmikin:

Yes, this is possible, in theory. However, the method of boosting implies building a set of consecutive trees on different predictors, which means that the right boundary can be chosen for another feature (if there is statistical justification), so the "error" is leveled out.

Sometimes there is a feeling that this is not an error at all and the dependence of the response on the attributes (in our problems) may wellsometimes be jumpy.

Aleksey Vyazmikin:

CatBoost also gives estimates of class membership probability, but from my observations it is exactly the opposite - higher confidence in rare observations which do not occur often enough and it leads to their overestimation, and on an independent sample it will lead either to a wrong classification or even more rare occurrence of a high indicator.

What I mean is that a trained model for each particular set of features, instead of answering "either 0 or 1", will give the answer as a number on a segment between 0 and 1. Logistic regression, for example, works this way. In random forests it seems to work that way too, but I don't know if that's what you mean or if you mean metrics.

 
Dmitry Fedoseev:

Dimitri, please help, I need to change the cut[] array in the algorithm from int to float, but the compiler is throwing errors.

 
Valeriy Yastremskiy:

I only know a two-pass method. First you make a map, then you choose a path. Immediately, without a map you can also go, but it is much more risky, especially when ravines and swamps on the way, and no compass, stars and sun).

Total darkness awaits intrepid wayfarers :)

Valeriy Yastremskiy:

The question is the cost of action and the availability of initial data. Apparently we have to set the goal from here. Conditions may be different. We know the number of points and segments. We do not know the number of segments, but we know the number of points, we do not know the number of points and segments, we only know that they are quite a lot. We know that the number of segments from a point is at most N.

So this part has to be formalized first.

We know the number of points and line segments at the start of our search, we even know the probable maximum number of line segments we can fit in one to 40 (if the segment contains at least 5% of points of the same target at two options).

The actual number of segments can be different for the search - now I got that from 1 to 263, but there can be duplicates.

 
Aleksey Nikolayev:

Sometimes there is a sense that this is not an error at all and the dependence of the answer on the features (in our problems) may wellsometimes be jumpy.

If we're talking about statistically hitting a higher percentage of one of the classes, then yes, the sections next to each other may have a different predisposition to the target. I even want to try a transformation to facilitate learning, the essence of the transformation would be to rank the segments by the type of belonging to the target and the degree of probability, so the left side would be segments for zeros, and the right side for units - in the centre weakly expressed.

Aleksey Nikolayev:

I mean that the trained model for each particular set of features, instead of answering "either 0 or 1", will give the answer as a number on a segment from 0 to 1. Logistic regression, for example, works this way. In random forests it seems to work that way too, but I don't know if that's what you mean or if you're talking about metrics.

This is the CatBoost model after training on the x-axis probability scale - the blue curve is the number of examples, you can see that their number is decreasing.

Aqua is class 0 and magnetta is class 1. The red curve is loss, the light blue one is gain.

and this is the same model on an independent sample.

Do you think the logistic regression will have a different distribution?

The logistic regression algorithm itself loses out to CatBoost without parameter tuning.

 
Aleksey Vyazmikin:

Do you think logistic regression will have a different distribution?

The logistic regression algorithm itself, without parameter tuning, loses to CatBoost.

No, I'm not talking about comparing algorithms in practice. I'm interested in a philosophical question, how to choose an algorithm and train it correctly, taking into account that classes can be a) clearly separated from each other, b) mixed, c) some mixture of points a) and b). For (a) you need a clear classification, for (b) you need a fuzzy one, and for (c) you need to mix them somehow, but not shake them up.

Perhaps I should move my question to the MoD thread.

 
Aleksey Nikolayev:

No, I'm not talking about comparing algorithms in practice. I am interested in a philosophical question, how to choose an algorithm and train it correctly considering that classes can be a) clearly separated from each other, b) mixed, c) some mixture of (a) and (b). For (a) you need a clear classification, for (b) you need a fuzzy one, and for (c) you need to mix them somehow, but not shake them up.

Perhaps I should move my question to the MoD thread.

Any algorithm can probably cope with a clear separation. The question is which algorithm can better allocate a subspace to highlight areas of jumbled classes.

The problem with partitioning in trading is the questionable validity of the partitioning - hence the added difficulty in training.

I haven't worked with many currently available MO methods, so I can't adequately assess their strengths and weaknesses.

 
Can extrapolate space into the future in the form of fractal clusters .
 
Veniamin Skrepkov:
Can extrapolate space into the future in the form of fractal clusters .

Can you show me how to do it?