GClasses
GClasses::GDataRowSplitter Class Reference

Detailed Description

This class divides a features and labels matrix into two parts by randomly assigning each row to one of the two parts, keeping the corresponding rows together. The rows are shallow-copied. The destructor of this class releases all of the row references.

#include <GMatrix.h>

Public Member Functions

 GDataRowSplitter (const GMatrix &features, const GMatrix &labels, GRand &rand, size_t part1Rows)
 features and labels are expected to remain valid for the duration of this object. proportion specifies the proportion of rows that will be referenced by part 1 of the data. (In case of an exact tie, part 2 gets the extra row.) More...
 
 ~GDataRowSplitter ()
 
const GMatrixfeatures1 ()
 Returns a reference to the first part of the features matrix. More...
 
const GMatrixfeatures2 ()
 Returns a reference to the second part of the features matrix. More...
 
const GMatrixlabels1 ()
 Returns a reference to the first part of the labels matrix. More...
 
const GMatrixlabels2 ()
 returns a reference to the second part of the labels matrix More...
 

Protected Attributes

GMatrix m_f1
 
GMatrix m_f2
 
GMatrix m_l1
 
GMatrix m_l2
 

Constructor & Destructor Documentation

GClasses::GDataRowSplitter::GDataRowSplitter ( const GMatrix features,
const GMatrix labels,
GRand rand,
size_t  part1Rows 
)

features and labels are expected to remain valid for the duration of this object. proportion specifies the proportion of rows that will be referenced by part 1 of the data. (In case of an exact tie, part 2 gets the extra row.)

GClasses::GDataRowSplitter::~GDataRowSplitter ( )

Member Function Documentation

const GMatrix& GClasses::GDataRowSplitter::features1 ( )
inline

Returns a reference to the first part of the features matrix.

const GMatrix& GClasses::GDataRowSplitter::features2 ( )
inline

Returns a reference to the second part of the features matrix.

const GMatrix& GClasses::GDataRowSplitter::labels1 ( )
inline

Returns a reference to the first part of the labels matrix.

const GMatrix& GClasses::GDataRowSplitter::labels2 ( )
inline

returns a reference to the second part of the labels matrix

Member Data Documentation

GMatrix GClasses::GDataRowSplitter::m_f1
protected
GMatrix GClasses::GDataRowSplitter::m_f2
protected
GMatrix GClasses::GDataRowSplitter::m_l1
protected
GMatrix GClasses::GDataRowSplitter::m_l2
protected