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

 
Mihail Marchukajtes:

I wrote and wrote, then the forum glitched, so read from the picture, it's good that at least I made it...

the good news is that you made it. xgboost in R instead of ecclmn or whatever c...ni you use

I'll soon translate something to python and boosting and see what improvements will be made
 
Maxim Dmitrievsky:

Plug xgboost into R instead of eclmn or whatever c...ni you're using

I will soon translate something to python and boosting and see what improvements there will be

Downloaded. Installed it. But I don't think I can do it without Doc. That's if he posted a script with an example, how to use it. Then I think it would be possible to try. Again, the question of transferring the model to MT? I do not want to build bridges or something else. How may I transfer a model from xboost to MT4?

 
Mihail Marchukajtes:

Downloaded. Installed it. But I don't think I can do it without Doc. That's if he posted a script with an example, how to use it. Then I think it would be possible to try. Again, the question of transferring the model to MT? I do not want to build bridges or something else. How can I transfer a model from xboost to MT4?

I don't know, it appeals to those who are fond of it.

I will connect python. i think it is possible to connect xgb to the terminal through a dll, i should ask those who know about dll, i don't know

here is a normal article for pythonhttps://www.analyticsvidhya.com/blog/2016/03/complete-guide-parameter-tuning-xgboost-with-codes-python/

and the author has a comparison of GBM in another article (to give you an idea how the booster works)

 

Charged the xgb from the example at the link, but on a laptop GPU - it works :) you can achieve a 10x acceleration, although it is already pretty fast

And it turns out that dll can be called directly from MT4/5 and even with GPU support. It's just a matter of getting a better understanding of the subject

 
Maxim Dmitrievsky:

Huh, that's for those of you who are into R.

I will connect python. The idea is that xgb can generally be connected via dll to the terminal, you need to ask those who know about dll, I do not know

here is a normal article for python https://www.analyticsvidhya.com/blog/2016/03/complete-guide-parameter-tuning-xgboost-with-codes-python/

and the author has a comparison of GBM with another article (to have some idea how boosting works)

The topic of xgb is pretty tortured, starting from installation, building, etc. The Yandex library looks more consistent in this regard https://tech.yandex.com/catboost/doc/dg/concepts/about-docpage/

CatBoost — Overview of CatBoost — Yandex Technologies
CatBoost — Overview of CatBoost — Yandex Technologies
  • tech.yandex.com
is a machine learning algorithm that uses gradient boosting on decision trees. It is available as an open source library.
 
Ivan Negreshniy:

I'll try to import and use it in MT5 today. xgb is a very tricky subject, starting from installation, bilding etc. Yandex's library looks more consistent in this aspect https://tech.yandex.com/catboost/doc/dg/concepts/about-docpage/

No, it's simple, build the lib and install it. There are already assembled, you just need to copy and install the lib from the local folder, including gpu

gpu for boost models gives a small acceleration, because the model is built in series, and only splits in separate trees are paralleled, i.e. there is no sense

If I try to build a model in series, it will speed up a little, but the parallelism is only for the splits in separate trees.

i'll try to import it to MT5 today

 
Maxim Dmitrievsky:

No, it's simple, build the lib and install it. There are already assembled, you just need to copy and install the lib from the local folder, including gpu

gpu for boost models gives a small acceleration, because the model is built in series, and only splits in separate trees are paralleled, so there's no sense

For example, it makes no sense to build a booster model in series, while the model is built in parallel only in separate trees, so it makes no sense. Cutbust, Light GBM and others are very inferior (kind of fake) :) at least that's what users write in web

Perhaps someone has gained a lot of experience and checked it out expertly, but I at first glance seemed that there is a lot of variation, and more I want a MO with stable results and that less shamanism:)))

 
Ivan Negreshniy:

Perhaps someone has already gained a lot of experience and checked it out expertly, but to me at first glance it seemed that there is a lot of variation, and all I want more MO with stable results and that less shamanism:)))

Yeah, it still needs tuning... well, I'll try it

i found a wrapper for sharps on how to import fonts from dll... only i don't know if crossvalidation is not there by default, it seems to come separately

https://github.com/PicNet/XGBoost.Net/blob/master/XGBoost/lib/XGBOOST_NATIVE_METHODS.cs

 
//+------------------------------------------------------------------+
//|                                                      xgboost.mq5 |
//|                                 Copyright 2018, Max Dmitrievskiy |
//|                        https://www.mql5.com/ru/users/dmitrievsky |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, Max Dmitrievskiy"
#property link      "https://www.mql5.com/ru/users/dmitrievsky"
#property version   "1.00"
#import "xgboost.dll"
string XGBGetLastError();
int XGDMatrixCreateFromMat(float&[],ulong nrow,ulong ncol,float missing,int handle);
int XGDMatrixFree(int handle);
int XGDMatrixGetFloatInfo(int handle,string field, ulong len, int result);
int XGDMatrixSetFloatInfo(int handle,string field,float&[],ulong len);
int XGBoosterCreate(int&[],ulong len, int handle);
int XGBoosterFree(int handle);
int XGBoosterSetParam(int handle,string name,string val);
int XGBoosterUpdateOneIter(int bHandle,int iter,int dHandle);
int XGBoosterPredict(int bHandle,int dHandle,int optionMask,int ntreeLimit, ulong predsLen, int predsPtr);
int XGBoosterSaveModel(int bHandle,string fileName);
int XGBoosterLoadModel(int bHandle,string fileName);
int XGDMatrixCreateFromFile(string fname,int silent, int DMtrxHandle);
int XGBoosterDumpModel(int handle,string fmap,int with_stats, int out_len, int dumpStr);
#import
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--

   int a[1]={1};
   ulong ab=1;
   int hnd=1;
   XGBoosterCreate(a, ab, hnd);
  }
//+------------------------------------------------------------------+

I guess I can't do it myself, I'll have to use python after all :D

2018.05.31 15:00:17.587 xgboost (EURUSD,M15)    Access violation at 0x00007FFA5D7BA68E read to 0xFFFFFFFFFFFFFFFF in 'C:\Users\dmitrievsky\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Libraries\xgboost.dll'
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)       crash -->  00007FFA5D7BA68E 498B4708          mov        rax, [r15+0x8]
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)                  00007FFA5D7BA692 4885C0            test       rax, rax
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)                  00007FFA5D7BA695 7404              jz         0x7ffa5d7ba69b
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)                  00007FFA5D7BA697 F0FF4008          lock inc        dword [rax+0x8]
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)                  00007FFA5D7BA69B 498B07            mov        rax, [r15]
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)                  00007FFA5D7BA69E 488904DE          mov        [rsi+rbx*8], rax
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)                  00007FFA5D7BA6A2 498B4708          mov        rax, [r15+0x8]
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    00: 0x00007FFA5D7BA68E
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    01: 0x000000005B0FAB91
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    02: 0x0000000000000001
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    03: 0x0000000000000246
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    04: 0x00007FF784D2BBB4
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    05: 0x00007FF784D2B933
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    06: 0x00007FF7851BEA5E
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    07: 0x00007FF7851BD979
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    08: 0x00007FF784C09A90
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    09: 0x00007FFA870C3034
2018.05.31 15:00:17.592 xgboost (EURUSD,M15)    10: 0x00007FFA87531551
 
Maxim Dmitrievsky:

Yeah, it still needs tuning... well, I'll try

I found a sharps wrapper to import fonts from dll... only I don't understand that there is no default crossvalidation, it seems to come separately

https://github.com/PicNet/XGBoost.Net/blob/master/XGBoost/lib/XGBOOST_NATIVE_METHODS.cs

IMHO, you have to work in python first, where it is more or less debugged, otherwise there is a lot of uncertainty

Reason: