L'apprendimento automatico nel trading: teoria, modelli, pratica e algo-trading - pagina 908

 
Mihail Marchukajtes:

Vtreat.R.

Grazie.

È qualcosa in R?

Ho provato il mio kit in Rattle - ho selezionato l'apprendimento su tutte le reti, ma alla fine ho ottenuto un errore dopo un sacco di riflessioni


 
Elibrarius:

In cicli)).

Ma tutte le combinazioni e i PC saranno contati per ventiquattro ore...
10 predittori, combinazioni 2^10 = 1024.

20 predittori, = 2^20 = 1048576

Questo è il numero di volte che bisogna allenare una foresta/nS.

Non ho fretta... Potrei gettarlo su un computer separato e lasciare che conti da solo.

Ma quale software degno avete?

 
Mihail Marchukajtes:

Vtreat.R

Come posso eseguirlo? Chiamovtrear() e si acciglia.

--- Пожалуйста, выберите зеркало 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:

qualche foto? smettila di parlare di niente, anche tu non ne hai bisogno, lol :)

Non so nemmeno... Doc ha anche dato tutti i codici per MKUL in modo che il modello possa essere usato immediatamente in MT. L'unica cosa che non mi è piaciuta di elmnn è che non importa quante volte l'ho allenato, dà sempre lo stesso risultato su OOS. Quindi, non importa quante volte lo alleno, dà sempre lo stesso risultato :-) Ma il lavoro è appena iniziato e ho bisogno di altri test per avere un verdetto sicuro...

 
Aleksey Vyazmikin:

Come posso eseguirlo? Chiamovtrear() e si acciglia.

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

Comunque, va così. Ma è la valutazione per la classificazione dei target dove ci sono solo 0 e 1. Per la regressione è molto diverso...

 

Come interpretare correttamente il risultato di un modello di foresta casuale - è buono o cattivo?

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
======================================================================

Sui dati del test (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

Ecco perché non ho potuto dividerlo in due file, nessuno può spiegarlo chiaramente :(

 
Aleksey Vyazmikin:

Come posso eseguirlo? Chiamovtrear() e si acciglia.

Il pacchetto si chiama in modo diverso e ha bisogno di:

libreria(vtreat)

Il pacchetto contiene diverse funzioni, è troppo pigro per aprire la documentazione?

 
Mihail Marchukajtes:

Questo è tutto. Ma questa è una stima per la classificazione dell'obiettivo dove ci sono solo 0 e 1. Per la regressione è diverso...

Quindi non ha una shell grafica? Come lo invocate?

 
SanSanych Fomenko:

Il pacchetto si chiama in modo diverso e dovrebbe esserlo:

libreria(vtreat)

Il pacchetto contiene diverse funzioni, è troppo pigro per aprire la documentazione?

Dove trovare la documentazione?

 
Aleksey Vyazmikin:

Quindi non ha una shell grafica? Come si invoca una shell?

No. Ma ho scritto uno script che carica tutto in Excel e poi faccio la mia magia lì. Non posso darvi la sceneggiatura perché è il mio cervello.... Beh, ho fatto una bella cosa originale lì. Non so come stimi i predittori, ma il risultato è una tabella molto leggibile per ulteriori analisi... Così via...