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

 
Mihail Marchukajtes:

Vtreat.R

Thank you.

Is it something in R?

I tried my own set in Rattle - I selected learning on all networks, and ended up with an error after a long time of thinking


 
elibrarius:

In cycles))

But all combinations and PCs will be 24 hours counting...
10 predictors, 2^10 combinations = 1024

20 predictors, = 2^20 = 1048576

That's how many times you have to train a les/nS.

I'm in no hurry... I can throw it on a separate computer and let it count for itself.

But what worthy software is there?

 
Mihail Marchukajtes:

Vtreat.R

How can I run it? I callvtrear() and it frowns.

--- Пожалуйста, выберите зеркало CRAN для использования в этой сессии ---
пробую URL 'https://cran.univ-paris1.fr/bin/windows/contrib/3.5/vtreat_1.0.4.zip'
Content type 'application/zip' length 975668 bytes (952 KB)
downloaded 952 KB

пакет ‘vtreat’ успешно распакован, MD5-суммы проверены

Скачанные бинарные пакеты находятся в
        C:\Users\S_V_A\AppData\Local\Temp\RtmpeQVyba\downloaded_packages
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> vtrear()
Ошибка в vtrear() :не могу найти функцию "vtrear"
> utils:::menuInstallPkgs()
 
Maxim Dmitrievsky:

Will there be any pictures? stop talking about nothing, you don't need any good ones either, lol :)

I don't even know... Doc also gave all the codes for MKUL so the model can be used directly in MT. The only thing I didn't like about elmnn is that no matter how many times I trained it, it always give me the same result on OOS. So, no matter how many times I train it, it always produces the same result.) But the work has just started and I need more tests to get a confident verdict...

 
Aleksey Vyazmikin:

How can I run it? I callvtrear(), but it frowns.

forexFeatures<-forexFeatures1[i:n_rw,1:n_enter+1]
set.seed(1234)
#designTreatmentsC  подходит только для классификации с двумя классами
treatmentsC <- designTreatmentsC(dframe = forexFeatures,
                                varlist=colnames(forexFeatures)[-ncol(forexFeatures)], #названия  колонок с предикторами (тут - все кроме последней колонки)
                                 outcomename = colnames(forexFeatures)[ncol(forexFeatures)], #названия  колонок с таргетом (тут - последняя колонка)
                                 outcometarget = "1") #текст  или цифра одного из классов
#обработка,  сортировка результата
treatmensC_scores <- treatmentsC$scoreFrame[order(treatmentsC$scoreFrame$sig),]
treatmensC_scores <- treatmensC_scores[!duplicated(treatmensC_scores$origName),]
treatmensC_scores <- treatmensC_scores[,c("origName","sig")] 
treatmensC_scores$is_good <- treatmensC_scores$sig <= 1/nrow(forexFeatures)
treatmensC_scores

Anyway, it's like this. But this is evaluation for target classification where there are only 0 and 1. It's different for regression...

 

How to correctly interpret the result of the random forest model - is it good or bad?

Summary of the Random Forest Model
==================================

Number of observations used to build the model: 282752
Missing value imputation is active.

Call:
 randomForest(formula = as.factor(arr_Sell) ~ .,
              data = crs$dataset[crs$sample, c(crs$input, crs$target)],
              ntree = 500, mtry = 5, importance = TRUE, replace = FALSE, na.action = randomForest::na.roughfix)

               Type of random forest: classification
                     Number of trees: 500
No. of variables tried at each split: 5

        OOB estimate of  error rate: 0.85%
Confusion matrix:
      -1      0 class.error
-1 21438   1825 0.078450759
0    584 258905 0.002250577

Analysis of the Area Under the Curve (AUC)  
==========================================

Call:
roc.default(response = crs$rf$y, predictor = as.numeric(crs$rf$predicted))

Data: as.numeric(crs$rf$predicted) in 23263 controls (crs$rf$y -1) < 259489 cases (crs$rf$y 0).
Area under the curve: 0.9596

95% CI: 0.9579-0.9614 (DeLong)

Variable Importance
===================

                                 -1      0 MeanDecreaseAccuracy
arr_iDelta_MN1               138.27 133.11               140.22
arr_iDelta_H6                125.08 121.39               133.93
arr_iDelta_H12               123.70 122.14               133.35
arr_Regresor                 128.66 115.53               127.84
arr_iDelta_W1                139.04 113.42               127.63
arr_iDelta_Min_D1            116.08 109.00               118.71
arr_LastBarPeresekD_Up_M15   104.77 115.87               118.67
arr_LastBarPeresekD_Down_M15 101.57 111.98               114.99
arr_TimeH                    109.29 110.21               111.94
arr_iDelta_Max_H1            106.04 102.77               109.00
arr_DonProcVisota             95.92 109.61               106.40
arr_iDelta_D1                116.65  90.42               103.11
arr_iDelta_Max_D1             96.33  94.41               101.86
arr_iDelta_H4                 78.47  90.86                90.15
arr_DonProc_M15               78.25  84.56                85.65
arr_Den_Nedeli                83.49  81.88                83.28
arr_DonProc                   58.30  84.22                76.08
arr_iDelta_H3                 55.64  64.18                62.44
arr_RSI_Open_H1               70.07  47.21                58.58
arr_LastBarPeresekD_Up        49.16  59.19                56.28
arr_iDelta_Min_H1             47.12  60.19                55.55
arr_Vektor_Week               53.23  52.12                54.44
arr_iDelta_H1                 41.20  48.63                46.96
arr_Vektor_Don_M15            46.79  40.64                45.61
arr_LastBarPeresekD_Down      33.46  42.79                39.32
arr_Vektor_Day                31.94  32.05                32.78
arr_Vektor_Don                18.94  22.51                21.50
arr_BB_Center                 19.91  21.46                21.07
arr_RSI_Open_M1               24.14  15.21                18.13
arr_BB_Down                   18.22  13.54                15.41
arr_BB_Up                     11.74  12.82                13.13
                             MeanDecreaseGini
arr_iDelta_MN1                        1786.84
arr_iDelta_H6                         1257.97
arr_iDelta_H12                        1286.82
arr_Regresor                          1162.09
arr_iDelta_W1                         1611.97
arr_iDelta_Min_D1                     1009.56
arr_LastBarPeresekD_Up_M15             990.33
arr_LastBarPeresekD_Down_M15          1051.66
arr_TimeH                             1718.65
arr_iDelta_Max_H1                      945.35
arr_DonProcVisota                     1146.33
arr_iDelta_D1                         1179.92
arr_iDelta_Max_D1                     1036.35
arr_iDelta_H4                         1182.16
arr_DonProc_M15                       1102.40
arr_Den_Nedeli                        1185.70
arr_DonProc                            699.24
arr_iDelta_H3                         1163.34
arr_RSI_Open_H1                        228.25
arr_LastBarPeresekD_Up                 839.31
arr_iDelta_Min_H1                      760.00
arr_Vektor_Week                        278.21
arr_iDelta_H1                          778.78
arr_Vektor_Don_M15                     220.85
arr_LastBarPeresekD_Down               731.15
arr_Vektor_Day                         155.12
arr_Vektor_Don                         215.34
arr_BB_Center                          155.38
arr_RSI_Open_M1                         99.55
arr_BB_Down                             82.22
arr_BB_Up                               56.65

Time taken: 1.26 hours

Rattle timestamp: 2018-05-14 04:12:32 S_V_A
======================================================================

On the test data (15%)

Error matrix for the Random Forest model on Pred_023.csv [test] (counts):

      Predicted
Actual   -1     0 Error
    -1 4502   409   8.3
    0   125 55555   0.2

Error matrix for the Random Forest model on Pred_023.csv [test] (proportions):

      Predicted
Actual  -1    0 Error
    -1 7.4  0.7   8.3
    0  0.2 91.7   0.2

Overall error: 0.9%, Averaged class error: 4.25%

Rattle timestamp: 2018-05-14 12:48:08 S_V_A

That's how I could not divide into two files, no one can intelligibly explain :(

 
Aleksey Vyazmikin:

How can I run it? I callvtrear() and it frowns.

The package is called differently and it needs:

library(vtreat)

The package contains several functions, why are you too lazy to open documentation?

 
Mihail Marchukajtes:

That's about it. But this is an estimate for the target classification where there are only 0 and 1. It's different for regression...

So it has no graphical shell? How do you open it?

 
SanSanych Fomenko:

The package is called differently and you need to:

library(vtreat)

The package contains several functions, is it too lazy to open the documentation?

Where to get the documentation?

 
Aleksey Vyazmikin:

So it has no graphical shell? And how do you call the help?

No. But I wrote a script that unloads everything into Excel for me and then I work my magic there. I can't give you the script, because it's my brainchild.... Well, I'm there funky original thing done. I don't know how to estimate the predictors, but the result is very readable and convenient table for further analysis ... So on...

Reason: