GClasses
GClasses::GDataPreprocessor Class Reference

Detailed Description

This class facilitates automatic data preprocessing. The constructor requires a dataset and some parameters that specify which portion of the data to use, and how the data should be transformed. A transform will automatically be generated to preprocess the data to meet the specified requirements, and the data will be transformed. Additional datasets can be added with the "add" method. These will be processed by the same transform. The processed data can be retrieved with the "get" method, with an index corresponding to the order of the data.

#include <GTransform.h>

Public Member Functions

 GDataPreprocessor (const GMatrix &source, size_t rowStart=0, size_t colStart=0, size_t rowCount=(size_t)-1, size_t colCount=(size_t)-1, bool allowMissing=false, bool allowNominal=false, bool allowContinuous=true, double minVal=-1.0, double maxVal=1.0)
 Generates a transform and preprocesses the specified portion of source to meet the specified data requirements. More...
 
void add (const GMatrix &source, size_t rowStart=0, size_t colStart=0, size_t rowCount=(size_t)-1, size_t colCount=(size_t)-1)
 Adds another dataset, and transforms it with the same transform used to preprocess the original data. More...
 
GMatrixget (size_t index)
 Returns the preprocessed version of the data. index specifies which dataset, such that get(0) returns the preprocessed form of the original data passed to the constructor, get(1) returns the preprocessed form of the first dataset added by a call to "add", get(2) is the preprocessed form of the second dataset added, and so forth. More...
 

Static Public Member Functions

static GIncrementalTransformautoTrans (const GMatrix &data, bool allowMissing=false, bool allowNominal=false, bool allowContinuous=true, double minVal=-1.0, double maxVal=1.0)
 Automatically prepares and trains a minimal transform for the provided data to prep it to meet specified requirements. Returns nullptr if no transformation is needed. More...
 

Protected Attributes

std::vector< GMatrix * > m_processedData
 
GIncrementalTransformm_pTransform
 

Constructor & Destructor Documentation

GClasses::GDataPreprocessor::GDataPreprocessor ( const GMatrix source,
size_t  rowStart = 0,
size_t  colStart = 0,
size_t  rowCount = (size_t)-1,
size_t  colCount = (size_t)-1,
bool  allowMissing = false,
bool  allowNominal = false,
bool  allowContinuous = true,
double  minVal = -1.0,
double  maxVal = 1.0 
)

Generates a transform and preprocesses the specified portion of source to meet the specified data requirements.

Member Function Documentation

void GClasses::GDataPreprocessor::add ( const GMatrix source,
size_t  rowStart = 0,
size_t  colStart = 0,
size_t  rowCount = (size_t)-1,
size_t  colCount = (size_t)-1 
)

Adds another dataset, and transforms it with the same transform used to preprocess the original data.

static GIncrementalTransform* GClasses::GDataPreprocessor::autoTrans ( const GMatrix data,
bool  allowMissing = false,
bool  allowNominal = false,
bool  allowContinuous = true,
double  minVal = -1.0,
double  maxVal = 1.0 
)
static

Automatically prepares and trains a minimal transform for the provided data to prep it to meet specified requirements. Returns nullptr if no transformation is needed.

GMatrix& GClasses::GDataPreprocessor::get ( size_t  index)
inline

Returns the preprocessed version of the data. index specifies which dataset, such that get(0) returns the preprocessed form of the original data passed to the constructor, get(1) returns the preprocessed form of the first dataset added by a call to "add", get(2) is the preprocessed form of the second dataset added, and so forth.

Member Data Documentation

std::vector<GMatrix*> GClasses::GDataPreprocessor::m_processedData
protected
GIncrementalTransform* GClasses::GDataPreprocessor::m_pTransform
protected