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

 
Mickey Moose:
Can you teach a machine to recognize pictures?

???

you don't have google?

 
mytarmailS:

???

you don't have google?

So you are incapable of doing this?
 
Mickey Moose:
So you can't do it?

I can...

What makes you think that? And your question was about something else, by the way.

 

Question for connoisseurs. Why the buffer is displayed in the print, but the line does not want to draw, and the other indicator is not called????

 
mytarmailS:

I can...

Where did that come from? And your question was about something else, by the way.


From your answer.

I want to build a pattern recognition module into my robot which is written in µl and I'm trying to figure out what to put in it and what it should consist of.

and if you send me to google i'll conclude it's impossible (in your version)

 
Mickey Moose:


any classifier, the picture is represented as a matrix

What's the problem? Or do you want me to write you a code?

 
mytarmailS:
any classifier, the picture is represented as a matrix

What's the problem? Or do you want me to write you a code?

I want to understand what you need to set the parameters of recognition, what to look for and what it's called. Exactly the descriptions of the tools
 
Mickey Moose:
I want to understand what it takes to set recognition parameters with what to look for and what it's called. Exactly the descriptions of the tools
You can go here, maybe you'll understand what's what.

Regards.
 

https://www.youtube.com/channel/UCPk8m_r6fkUSYmvgCBwq-sw/videos

A course on neuronics for image recognition, videos from university lectures. Very good, but in English.

 

This question: RF output usually gives AVGerr and RMSerr around

0.0000921245

0.0000920833

0.0000926474

0.0000930916

It's AVGerr.

Why so many zeros? I have seen in articles that errors are usually 0.1, 0.9, etc.

Calculated like this:

static double CDForest::DFAvgError(CDecisionForest &df,CMatrixDouble &xy,
                                   const int npoints)
  {
//--- create variables
   double result=0;
   int    i=0;
   int    j=0;
   int    k=0;
   int    i_=0;
//--- creating arrays
   double x[];
   double y[];
//--- allocation
   ArrayResizeAL(x,df.m_nvars);
   ArrayResizeAL(y,df.m_nclasses);
//--- initialization
   result=0;
   for(i=0;i<=npoints-1;i++)
     {
      //--- copy
      for(i_=0;i_<=df.m_nvars-1;i_++)
         x[i_]=xy[i][i_];
      //--- function call
      DFProcess(df,x,y);
      //--- check
      if(df.m_nclasses>1)
        {
         //--- classification-specific code
         k=(int)MathRound(xy[i][df.m_nvars]);
         for(j=0;j<=df.m_nclasses-1;j++)
           {
            //--- check
            if(j==k)
               result=result+MathAbs(y[j]-1);
            else
               result=result+MathAbs(y[j]);
           }
        }
      else
        {
         //--- regression-specific code
         result=result+MathAbs(y[0]-xy[i][df.m_nvars]);
        }
     }
//--- return result
   return(result/(npoints*df.m_nclasses));
  }

And here's a check script to calculate the multiplication table (I teach the RF table):

#include <Math\Alglib\dataanalysis.mqh>
//+------------------------------------------------------------------+
#define _rand(min,max) ((rand()/(double)SHORT_MAX)*((max)-(min))+min)
//+------------------------------------------------------------------+
void OnStart()
{
   CDecisionForest      Trf;
   CDecisionForestShell RFshell;
   CMatrixDouble        PatternsMatrix;
   CDFReport            RF_report;
   int RFinfo;
   double vector[2], out[1];
   
   // подготовка данных
   PatternsMatrix.Resize(100,3);
   int m=0;     // first pattern
   for(int i=1; i<=10; i++)
      for(int j=1; j<=10; j++)
      {
         PatternsMatrix[m].Set(0,i/10.0);       // input 1
         PatternsMatrix[m].Set(1,j/10.0);       // input 2
         PatternsMatrix[m].Set(2,(i*j)/100.0);  // target
         m++; //next pattern
      }
   // создание RF
   CDForest::DFBuildRandomDecisionForest(PatternsMatrix,100,2,1,500,1,RFinfo,Trf,RF_report);
   Print("Info=",RFinfo,"  Error=",DoubleToString(CDForest::DFAvgError(Trf,PatternsMatrix,100),50));  
   // проверка сети на целочисленных данных
   string s="Тест 1 >> ";
   for(int i=1; i<=10; i++)
   {
      int d1=(int)_rand(1,10), d2=(int)_rand(1,10);
      vector[0]=d1/10.0;
      vector[1]=d2/10.0;
      CDForest::DFProcess(Trf,vector,out);
      s+=(string)d1+"*"+(string)d2+"="+DoubleToString(out[0]*100,0)+" // ";
   }
   Print(s);
   // проверка сети на дробныx данных
   s="Тест 2 >> ";
   for(int i=1; i<=5; i++)
   {
      double d1=NormalizeDouble(_rand(1,10),1), d2=NormalizeDouble(_rand(1,10),1);
      vector[0]=d1/10.0;
      vector[1]=d2/10.0;
       CDForest::DFProcess(Trf,vector,out);
      s+=DoubleToString(d1,1)+"*"+DoubleToString(d2,1)+"="+DoubleToString(out[0]*100,2)+
         "("+DoubleToString(d1*d2,2)+") // ";
   }
   Print(s);
}

You can run it, check it, the multiplication table counts fine

And also very small error: 2017.09.27 16:26:12.267 RF sample (EURUSD,H1) Info=1 Error=0.0000000000000020


Reason: