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

 
Vladimir Perervenko:

I did not get good results. You need predictors (unlike other models) that are highly correlated.

I did not find such, which would give acceptable results. But I haven't experimented for a long time. I don't have much time. Please try it. The sample has a fully workable code.

Good luck

PS. If you try it, in matrices fed to the input, the predictors should be rows not columns.

Thanks, but I'm unfortunately now engaged in a completely different, in the near future will not be able to sit down, I came across a working method, but all still raw, research has just begun and feel it will drag on for a long time, a lot of work ...

Another question, don't beat on me) Is it possible to use standard MO packages, forrests, networks, vectors, convolutions, etc. in training without a teacher?

I suspect so, but I couldn't figure out how to

For example in forex

data("iris")

library(randomForest)

label <- factor(iris$Species)
set <- iris[,-ncol(iris)]


model <- randomForest(x = set,data = set , mtry=4, ntree=20)

I think I taught it without a teacher.

according to google translator ----> unsupervised classification

> model

Call:
randomForest(x = set, ntree = 20, mtry = 4, data = set)
               Type of random forest: unsupervised
                     Number of trees: 20
No. of variables tried at each split: 4

but now how to recognize? ))

predict(model , set[1,])



Error in predict.randomForest(model, set[1, ]) :
  No forest component in the object


Can you help me to clarify this case?

 
mytarmailS:

Thank you, but I am unfortunately now engaged in a completely different, in the near future will not be able to sit down, vredi caught on the working method, but all still raw, research just beginning and feel delayed for a long time, a lot of work ...

Another question, don't beat on me) Is it possible to use standard MO packages, forrests, networks, vectors, convolutions, etc. in training without a teacher?

I suspect so, but I couldn't figure out how to

For example in forex

data("iris")

library(randomForest)

label <- factor(iris$Species)
set <- iris[,-ncol(iris)]


model <- randomForest(x = set,data = set , mtry=4, ntree=20)

I think I taught it without a teacher.

according to google translator ----> unsupervised classification

> model

Call:
randomForest(x = set, ntree = 20, mtry = 4, data = set)
               Type of random forest: unsupervised
                     Number of trees: 20
No. of variables tried at each split: 4

but now how to recognize? ))

predict(model , set[1,])



Error in predict.randomForest(model, set[1, ]) :
  No forest component in the object


Is there any way you can clear this up for me?

================================================

I strongly recommend you to use "RandomUniformForest". There's a lot of features there that other "scaffolding" doesn't have. Specifically on Unsupervised Learning :

Unsupervised Learning with Random Uniform Forests

Description

Unsupervised mode of Random Uniform Forests is designed to provide, in all cases, clustering, dimension reduction, easy visualization, deep variable importance, relations between observations, variables and clusters. It also comes with two specific points: easy assessment (cluster analysis) and dynamic clustering, allowing to change on-the-fly any clustering shape. A three-layer engine is used: dissimilarity matrix, Multidimensional Scaling (MDS) or Spectral decomposition, and k-means or hierarchical clustering. The unsupervised mode does not require the number of clusters to be known, thanks to the gap statistic, and inherits of main algorithmic properties of the supervised mode, allowing (almost) any type of variable.

Good luck

 
Vladimir Perervenko:

Yes it is, the question is general, is it possible to teach without a teacher all these popular packages on ME - randomforest , nnet , svm ...... etc

Forrest, just taking it as an example...

Actually, I would like to teach a convolutional network without a teacher

 
mytarmailS:

Yes it is, the general question is whether it is possible to teach without a teacher all these popular MOE packages - randomforest , nnet , svm ...... etp

Forrest, just taking it as an example...

Actually, it's the convolutional network I want to teach without a teacher.

What do you want to teach it?

What is the idea behind it?

I only know these models to teach it without a teacher: AutoEncoder, RBM, RF of different varieties, clustering models. But the convolutional ones are impossible...

Good luck

 
Vladimir Perervenko:

What do you want to teach her?

What is the idea?

I know only these models for learning without a teacher: AutoEncoder, RBM, RF of different varieties, clustering models. But the convolutional ones are impossible...

Good luck

well, since a convolutional network can recognize similar patterns that are still slightly different in form, this sets it apart from the usual "linear" MOs

like Forrest, General Networks, etc...

And I want to teach without a teacher, because it's much better to first break it down into clusters, as if "naturally, by similarity" and then match it with the target, than to teach with the target immediately and sort of create/fit the clusters to the target

I wrote about the cluster idea, it does work better than any normal MOs for my target, if you read...

There's still one problem with it all, is that no situation in the market is exactly the same, it's non-stationarity, and here I see two ways, it's either a convolutional network or a dtw algorithm, or what's not so clear and vague is some kind of interpolation or extrapolation, I don't even know how to call it exactly.

The idea is to make clusters more adaptive to non-stationarity

 

Please help me understand...

There is a code like this:

#есть вектор с некими нужными событиями "999" и не нужными "0"

X <- rep(0,1000)
Y <- rep(999,100)

dat <- sample(c(X, Y))
dat
> dat
   [1]   0 999   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
  [28]   0   0   0 999 999   0   0   0   0   0   0   0   0   0   0 999   0   0   0   0   0   0   0   0   0 999   0
  [55]   0   0   0   0 999   0   0   0   0   0 999   0   0   0   0   0 999   0   0   0   0   0   0   0   0   0   0
  [82]   0   0   0   0   0   0   0   0 999   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
[109]   0   0   0   0   0   0   0   0 999   0   0   0 999   0   0   0   0   0   0   0   0   0   0   0   0   0   0
[136]   0   0   0   0   0   0   0 999   0   0   0   0   0 999   0 999   0   0   0   0   0   0   0   0   0   0   0

#///в каждой итерации цыкла я хочу видеть последние три нуждые события те когда было "999"

for(i in 101:length(dat)){
    
      idx <- 1:i
      
                  s1 <- dat[idx]
                  s2 <- which(s1!=0)  # s2 - получаем индексы нужного события те когда s1 было не ноль
                  s3 <- tail(s2,3)    # оставляем три поледних индекса
                  
                  print(  dat[s3]   )
                  
}

[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999
[1] 999 999 999

Everything is fine, everything works, but there is a problem in the line

idx <- 1:i

At each iteration the idx vector increases, and if there is a lot of data then the code becomes wildly slow of course, and the further the more...

I solved the problem simply, at each iteration will be taken only the last 100 values of the vector, not the entire

idx <- (i-100):i

for(i in 101:length(dat)){
    

      idx <- (i-100):i # последние 100 значени  вместо idx <- 1:i
      
                  s1 <- dat[idx]
                  s2 <- which(s1!=0)  # s2 - получаем индексы нужного события те когда s1 было не ноль
                  s3 <- tail(s2,3)    # оставляем три поледних индекса
                  
                  print(  dat[s3]   )
                  
}

But the output of this code already looks a bit messy

[1] 0 0 0
[1] 0 0 0
[1] 0 0 0
[1] 0 0 0
[1] 0 0 0
[1] 0 0 0
[1] 999   0   0
[1] 0 0 0
[1]   0   0 999
[1] 999   0   0
[1] 0 0 0
[1] 0 0 0

What the hell is wrong? Everything seems to be correct, is there a bug or something?

 
puzzled? :), apparently.
 

mytarmailS:


What the hell is going on? Everything is correct, is there a bug or something?

It's called "underwear", it's like you're shamelessly poking the ladies and gentlemen in the face with your underwear, and that doesn't really please the people around you. It is desirable to hide the underwear. Have you seen, for example, Nikolai Kositsyn or Reshetov, showing underwear?
 
pantural:

This is actually called "there is a bug, but no example of how to reproduce it". You need a table with more than 100 columns in a special way, and then something will go wrong with it. And for example given a small piece of table on which nothing to check, and even text, not RData file.

Purely at random - I think the error in the indexes. Values in s3 will always be from 1 to 100, regardless of the initial index i.
If you shift s1 by (i-100)-1 relative to the beginning of dat table, then this shift should be taken into account when you access dat again with the new obtained indices. The last line should be print(dat[i-101+s3]). It may be 100 instead of 101. Or 102. Somewhere in those numbers :)

 

pantural:
It's called "underwear", you seem to be unabashedly, underwear poking in the faces of ladies and gentlemen, and that doesn't really please those around you. It is desirable to hide the underwear. Have you seen, for example, Nikolai Kositsyn or Reshetov, showing underwear?

========================

Maybe you call it a "spoof", but in the R community it is customary to give a reproducible code when asking a question. And this is correct. Stories without code are empty words. The purpose of this thread is to educate on examples of MoD.

Why are you signing up for everyone around you? No need to make rules, no one authorized you to do so.

All right does mytarmailS and other participants, who give examples of code, which many can learn something useful for themselves.

Reason: