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

 
Maxim Dmitrievsky:

It's not hubris, a normal desire to share experiences, there are no envious, not that level of consciousness :) So write more.

I can not - today no trade.)) Yesterday evening the TS made about 100 points, which is excellent for the evening. Started to test it closer to the close of day session. So far everything is on the same chart (shown above).

First launch. I have not run it at the daytime yet.

 
Yuriy Asaulenko:

I can't - no trades today)). Yesterday evening the TS finally made about 100 points - just great for evening. Began testing closer to the close of the day session. So far everything is on the same chart (shown above).

First launch. I have not run it during the day yet.

Yesterday was a flat day in all markets and instruments.

This is romantic for neuronics and therefore it is profitable.

I think we will wait till the market will start moving, we will estimate the trading results and only then we will be able to make a conclusion.

 
Renat Akhtyamov:

Yesterday was a flat day, in general in all markets and instruments.

This is for neuronics - romance and profit.

We will wait for the market movements, we will estimate the trading results, and only then we will be able to say whether the trading was successful or not.

I think, that the daytime will be even better. Judging by the model and the preliminary debugging runs. But it is too early to say anything, of course.
 

Question for R experts.

How to convert a matrix with absolute values into a matrix of classes by softmax?

I.e. from

0.1136889 0.7622813 0.1190166
0.1131552 0.7641207 0.1194619
0.1142053 0.7635344 0.1197848

to get

0 1 0
0 1 0
0 1 0

I can of course run through the loop and compare everything, but it seems to me there should be a built-in R function.

I have created this function, correct me if I am mistaken


get_softmax <- function(m){
    r <- nrow(m);
    c <- ncol(m);
    rc <- r*c;
    mc <- max.col(m, "first"); #номера столбцов с макс. значением
    m[(1:rc)] <- 0; # обнулить матрицу
    m[(1:r) + r*(mc[1:r]-1)] <- 1; # 1 в столбец с макс. значением
    return(m);
}

 
elibrarius:

Question for R experts.

How to convert a matrix with absolute values into a matrix of classes by softmax?

I.e. from

0.1136889 0.7622813 0.1190166
0.1131552 0.7641207 0.1194619
0.1142053 0.7635344 0.1197848

to get

0 1 0
0 1 0
0 1 0

I can of course loop through and compare everything, but it seems to me there should be a built-in R function.

I have created this function, correct me if I'm wrong


get_softmax <- function(m){
    r <- nrow(m);
    c <- ncol(m);
    rc <- r*c;
    mc <- max.col(m, "first"); #номера столбцов с макс. значением
    m[(1:rc)] <- 0; # обнулить матрицу
    m[(1:r) + r*(mc[1:r]-1)] <- 1; # 1 в столбец с макс. значением
    return(m);
}


It looks like this:

b <- ifelse(a< 0.5, 0, 1) 

where "a" is a matrix of any dimension.

In general, your code with loops is not for vector (matrix) languages which are R

 
SanSanych Fomenko:

It seems like this:

where "a" is a matrix of any dimension.

In general, your code with loops is not for vector (matrix) languages, which is R

Will it work for several classes?
Variants of 3 classes

0.3 0.4 0.3

it will not calculate correctly.
If by softmax then the middle column should be 1, by your formula all columns = 0

 
elibrarius:

Will it work for several classes?
Variants of 3 classes

0.3 0.4 0.3

It won't calculate correctly.
If by softmax then the middle column should be 1, by your formula all columns = 0

ifelse как видно из синтаксиса дает два класса. На большее число классов я делил несколькими ifelse
 
SanSanych Fomenko:
ifelse как видно из синтаксиса дает два класса. На большее число классов я делил несколькими ifelse

You have to have your own function for 3rd grade, a different one for 4th grade, and a third one for 10th grade.
It would be nice to have a universal tool.
Also, you should compare not with some value (0.5 for you) but with each other in search of the maximum. At 10 classes the maximum value may be only 0.11. On the other hand at 10 classes there may be several columns >0.11. Which of them will be maximal - this formula will not tell. You have to compare them with each other.

 

Suppose we have a more or less stationary BP and have its frequency decomposition. Question: what is better for the model - 1 feature or 5, and why?


 
elibrarius:

You need your own function for 3 classes, another one for 4 classes, and a third one for 10 classes.
It would be nice to have a universal tool.
You should also compare not with some value (0.5 for you) but with each other in search of the maximum. At 10 classes maximal value may be only 0.11. On the other hand at 10 classes there may be several columns >0.11. Which of them will be maximal - this formula will not tell. You should compare them with each other.

0.5 is my known class boundary.

If neither class boundaries nor their number are known, there are other algorithms - teacherless learning. Very famous - grouping by nearest neighbors.