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

 
Aleksey Vyazmikin:

Catch

way <- "C:\\Users\\TARAS\\Desktop\\Test_Pred_2019.csv"  # ваш путь
dt <- read.csv(file = way,header = T,sep = ";") #  читаем файл
target <- dt$Target_100 #  целевую в отдельную переменную

dt <- dt[, ! colnames(dt)  %in% 
           c("Target_100_Buy","Target_100_Sell",
             "Time","Target_100")  ] #  удаляем не нужные колонки


#  роскоментируем и Устанавливаем нужные пакеты после чего эту строку можно удалить
#  install.packages(c("rgl", "car" , "umap"))


#  про umap
#https://cran.r-project.org/web/packages/umap/vignettes/umap.html
#https://github.com/ropenscilabs/umapr

library(umap)
um <- umap(dt,n_components=3)   
#  n_components=3  во сколько измерений уменьшаем данные, можно 100 можно 1
#  можно 333, но нам для 3 д надо трех мерное пространство поетому у нас n_comp=3
um.res <- um$layout #  наши три вектора выход 



#тут  все настройки по пакету  car
#  http://www.sthda.com/english/wiki/amazing-interactive-3d-scatter-plots-r-software-and-data-visualization
library(car)  # 3 d

target <- as.factor(target)  #   target нужен для того чтобы окрасить точки в цвет целевой

scatter3d(x = um.res[,1], 
          y = um.res[,2], 
          z = um.res[,3],
          groups = target,
          grid = FALSE, 
          surface = FALSE,
          ellipsoid = FALSE,
            bg.col = "black")




#===============================
#  ирисы фишера как пример

data(iris)
head(iris)
sep.l <- iris$Sepal.Length
sep.w <- iris$Sepal.Width
pet.l <- iris$Petal.Length

scatter3d(x = sep.l, 
          y = sep.w, 
          z = pet.l,
          groups = iris$Species,
          grid = FALSE, 
          surface = FALSE,
          ellipsoid = FALSE,
          bg.col = "black")



You can also play with the parameters of umap , there are metrics, proximity, k-neighbors

um <- umap(dt,n_components=3,
           n_neighbors=30,
           min_dist= 0.5) 

Look in the vinette, there are many things there.

 
mytarmailS:

see




You can also play with umap parameters, there are metrics, proximity, k-neighbors

Check out the vinette, there's a lot there.

Interesting, thank you! Judging by the picture - trash? :)

I can not run it in my place.

Warning in install.packages :
  packages ‘rgl’, ‘car’, ‘umap’ are not available (for R version 3.5.0)

I understand that I have R is outdated - how to update it? :)

 
Aleksey Vyazmikin:

Interesting, thank you! Judging by the picture - garbage? :)

I can not run it in my place.

I understand that I have R outdated - how to update it? :)

I guess so, need to update it.

I guess so, garbage :))



i think you should generate millions of indicators, then copy them to a feature selection and put them in a folder. when you have 1000 meaningful indicators, you can do something

 
NeuralNetwork:
Hi all. Here is the monitoring of my account. It shows everything to shut everyone up forever. If you are losers in life, just shut up, and let others do the work. Neural networks work, it is your brain that does not work, that you claim the opposite !

can you give me a link to the source code on githab? maybe there's a theory there.

 
Aleksey Vyazmikin:

Interesting, thank you! Judging by the picture - garbage? :)

In 2D space, you can see some clumps of patterns.

but this can also be random, we need more data

 
mytarmailS:

In 2D space, you can see some clumps of patterns.

But it could also be random, we need more data.

You can try samples from different years.

I downloaded version 4 of R, as I was asked, and now it's giving me the heebie-jeebies with some quaternary argument.

> #  роскоментируем и Устанавливаем нужные пакеты после чего эту строку можно удалить
> install.packages(c("rgl", "car" , "umap"))
Error in install.packages : 3 arguments passed to .Internal(unlink) which requires 4
 

Reinstalled, tried to install, but again says there is no package for this version

> # роскоментируем и Устанавливаем нужные пакеты после чего эту строку можно удалить
> install.packages(c("rgl", "car" , "umap"))
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib:
  cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib:
  cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
  packages ‘rgl’, ‘car’, ‘umap’ are not available (for R version 4.0.2)
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.0:
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/PACKAGES'
The installation seems to go through R, not RStudio.
 
It seems to run, but is it possible to save these models, not to count again?
 
Aleksey Vyazmikin:
It seems to run, but is it possible to save these models, so as not to count again?

Sure, but what exactly do you need to save?

I have by the way R-3.6.3 )))) did not even know that already had a 4)


my.file <- модель или что угодно


save(  my.file ,  file = "C:\\Users.........\\myfile.RDat"

load( file =  "C:\\Users.........\\myfile.RDat)

 
mytarmailS:

Of course, what do you need to save?

I have by the way R-3.6.3 )))) did not even know that already had a 4)


Well here's a 3D model, let's say, which opens in a separate window and even there is no way how to make a screen, here's how it can be saved, and then just from a blank sheet to download and there will be a model?

That's how to interpret such a stacking?

By the way, how to set the colors to classes forcibly - I don't understand what is what?

Reason: