Fork me on GitHub
Library for MQL5 (MetaTrader) with support for Spark
CMLPDataFile Class Reference

Detailed Description

MLPDataFile = CSV in a binary format.

The byte order is Little-Endian.

Format:

int - NIn (only for Alglib_MultilayerPerceptron and Alglib_RandomForest)
int - NOut (only for Alglib_MultilayerPerceptron and Alglib_RandomForest)
int - header size
if (header size > 0) {
int - length of string
byte[] - UTF-16LE
...
}
int - data size
double[data size] - data array
...

The documentation for this class was generated from the following file:

Public Member Functions

 CMLPDataFile ()
 
 ~CMLPDataFile ()
 
int initWrite (const int file, const int nin, const int nout)
 
int initWrite (const int file, const int nin, const int nout, const string &_header[])
 
int initWriteValidation (const int file, const int nin, const int nout)
 
int initWriteValidation (const int file, const int nin, const int nout, const string &_header[])
 
int initRead (const int file, int &nin, int &nout)
 
int initReadValidation (const int file, int &nin, int &nout)
 
uint write (const double &data[])
 
uint write (const CRowDouble &data)
 
uint writeAll (const CMatrixDouble &data)
 
uint read (double &data[], int &size)
 
uint readAll (CMatrixDouble &data, const bool append=false)
 
void flush ()
 
void close ()
 

Static Public Member Functions

static void convert (const CRowDouble &data, double &array[])
 
static bool convertToCsv (const int file, const bool validation=false, const string delimiter=";")
 

Public Attributes

int handleFile
 
string path
 
string header []
 

Protected Member Functions

int initWrite0 (const string file, const int nin, const int nout, const string &_header[])
 
int initRead0 (const string file, int &nin, int &nout)
 

Constructor & Destructor Documentation

◆ CMLPDataFile()

CMLPDataFile::CMLPDataFile ( )

◆ ~CMLPDataFile()

CMLPDataFile::~CMLPDataFile ( )

Member Function Documentation

◆ close()

void CMLPDataFile::close ( )

◆ convert()

static void CMLPDataFile::convert ( const CRowDouble &  data,
double &  array[] 
)
static

◆ convertToCsv()

static bool CMLPDataFile::convertToCsv ( const int  file,
const bool  validation = false,
const string  delimiter = ";" 
)
static

◆ flush()

void CMLPDataFile::flush ( )

◆ initRead()

int CMLPDataFile::initRead ( const int  file,
int &  nin,
int &  nout 
)
Parameters
filenumber of file
[out]ninNIn
[out]noutNOut
Returns
handleFile

◆ initRead0()

int CMLPDataFile::initRead0 ( const string  file,
int &  nin,
int &  nout 
)
protected
Parameters
filepath of file
[out]ninNIn
[out]noutNOut
Returns
handleFile

◆ initReadValidation()

int CMLPDataFile::initReadValidation ( const int  file,
int &  nin,
int &  nout 
)
Parameters
filenumber of file
[out]ninNIn
[out]noutNOut
Returns
handleFile

◆ initWrite() [1/2]

int CMLPDataFile::initWrite ( const int  file,
const int  nin,
const int  nout 
)
Parameters
filenumber of file
[in]ninNIn
[in]noutNOut
Returns
handleFile

◆ initWrite() [2/2]

int CMLPDataFile::initWrite ( const int  file,
const int  nin,
const int  nout,
const string &  _header[] 
)
Parameters
filenumber of file
[in]ninNIn
[in]noutNOut
[in]_header
Returns
handleFile

◆ initWrite0()

int CMLPDataFile::initWrite0 ( const string  file,
const int  nin,
const int  nout,
const string &  _header[] 
)
protected
Parameters
filepath of file
[in]ninNIn
[in]noutNOut
[in]_header
Returns
handleFile

◆ initWriteValidation() [1/2]

int CMLPDataFile::initWriteValidation ( const int  file,
const int  nin,
const int  nout 
)
Parameters
filenumber of file
[in]ninNIn
[in]noutNOut
Returns
handleFile

◆ initWriteValidation() [2/2]

int CMLPDataFile::initWriteValidation ( const int  file,
const int  nin,
const int  nout,
const string &  _header[] 
)
Parameters
filenumber of file
[in]ninNIn
[in]noutNOut
[in]_header
Returns
handleFile

◆ read()

uint CMLPDataFile::read ( double &  data[],
int &  size 
)
Returns
Number of elements read.

◆ readAll()

uint CMLPDataFile::readAll ( CMatrixDouble &  data,
const bool  append = false 
)
Returns
Number of elements read.

◆ write() [1/2]

uint CMLPDataFile::write ( const double &  data[])
Returns
Number of recorded items.

◆ write() [2/2]

uint CMLPDataFile::write ( const CRowDouble &  data)
Returns
Number of recorded items.

◆ writeAll()

uint CMLPDataFile::writeAll ( const CMatrixDouble &  data)
Returns
Number of recorded items.

Member Data Documentation

◆ handleFile

int CMLPDataFile::handleFile

◆ header

string CMLPDataFile::header[]

◆ path

string CMLPDataFile::path