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

 
Aleksey Vyazmikin #:

I could say that about any language, and that people posting their codes are idiots!

What do you want me to do?
Do you want me to open the help, copy the sample code and paste it here for you?
Because you can't do it yourself
 
Aleksey Nikolayev #:

We'll have to see what Renata's example produces.

His example (public project ONNX.Price.Prediction) also produces negative numbers, but the input parameter dimension array is three long, not two as mine.

PS. I checked in the latest version of 3605, everything is unchanged.

OnnxTypeInfo otype;
OnnxGetInputTypeInfo(handle, 0, otype);
ArrayPrint(otype.dimensions);                   // -1 -1 4 (у меня: -1 8)
OnnxGetOutputTypeInfo(handle, 0, otype);
ArrayPrint(otype.dimensions);                   // -1 1 (у меня также)
 
mytarmailS #:
What do you want me to do?
Do you want me to open the help, copy the sample code and paste it here for you?
Because you can't do it yourself

Perhaps I want some action from the thread participants...

We used to post code here, so it would be good to revive those times.

 
Aleksey Vyazmikin #:

Yandex has many LLCs in Russia, through which various projects are carried out. How they legally get in touch with the parent company - we still need to study it.

A lot of LLCs is always an obvious sign of how serious and long-lasting everything is).

 
Aleksey Nikolayev #:

Lots of LLCs is always an obvious sign of how serious and long term things are)

It's a sign of working in RF....

Even Sber does this...
 
They have a band on the cart, every day support
The developers will answer the most tricky questions.
I nudged them, along with others, about a Mac m1 version, they did it in 6 months.
 
Maxim Dmitrievsky #:
Is it necessary to input a 2-dimensional matrix like in your example? It seems more logical to use a one-dimensional array with attributes. It may complain about the wrong form of the matrix. For example, instead of a one-dimensional one, you should give a 2-dimensional one, where each entry is in the 2nd dimension, i.e. nested arrays containing 1 value each.
.

You were right - in my example (onnx for busting) it is necessary to input a vector, not a matrix. And it should be a float vector, not a double one. The fact that in Python it was possible to input a matrix (several rows at once) is probably the result of Python vectorisation. To do this in MQL5, you will have to run the model in a loop, apparently.

A working version of the MQL5 script for my example:

void OnStart()
  {
   long h = OnnxCreate("model.onnx", FILE_COMMON);
   const long  ExtInputShape [] = {1,8};
   const long  ExtOutputShape[] = {1,1};
   OnnxSetInputShape(h,0,ExtInputShape);
   OnnxSetOutputShape(h,0,ExtOutputShape);
   
   vectorf vx={8.32520000 e+00 f, 4.10000000 e+01 f, 6.98412698 e+00 f, 1.02380952 e+00 f,
               3.22000000 e+02 f, 2.55555556 e+00 f, 3.78800000 e+01 f,-1.22230000 e+02 f};
   vectorf vy={0.0 f};
      
   OnnxRun(h, ONNX_DEBUG_LOGS | ONNX_NO_CONVERSION, vx, vy);
   Print(vx);
   Print(vy);
   OnnxRelease(h);
  }
Машинное обучение в трейдинге: теория, модели, практика и алготорговля - Если у вас динамическое IP, то не получается вывод в MQL5 из ONNX-модели.
Машинное обучение в трейдинге: теория, модели, практика и алготорговля - Если у вас динамическое IP, то не получается вывод в MQL5 из ONNX-модели.
  • 2023.03.07
  • www.mql5.com
либо обучать древесную модель и брать точку первого сплита по этому признаку. при обучении в питоне тестил модель на первых пяти строках датасета. Потом при запуске ONNX в питоне тоже проверил вывод на тех же первых пяти строках
 
Aleksey Nikolayev #:

should be a float vector, not double

If you remove the ONNX_NO_CONVERSION switch, you can input a double vector. The output must still be a float vector.

 
And here's my implementation of the EA on my own neuronics
 

The OnnxTypeInfo help lacks explanations about the dimensions[] field. It would be nice to explain the meaning of this array at least on the example of ONNX.Price.Prediction project, where (MT5 version 3621) it turns out like this:

   OnnxTypeInfo otype;
   OnnxGetInputTypeInfo(handle, 0, otype);
   Print(otype.type == ONNX_TYPE_TENSOR);               // true
   Print(otype.element_type == ONNX_DATA_TYPE_FLOAT);   // true
   ArrayPrint(otype.dimensions);                        // -1 -1 4
   OnnxGetOutputTypeInfo(handle, 0, otype);
   Print(otype.type == ONNX_TYPE_TENSOR);               // true
   Print(otype.element_type == ONNX_DATA_TYPE_FLOAT);   // true  
   ArrayPrint(otype.dimensions);                        // -1 1
Reason: