GClasses
|
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 GMatrix & | features1 () |
Returns a reference to the first part of the features matrix. More... | |
const GMatrix & | features2 () |
Returns a reference to the second part of the features matrix. More... | |
const GMatrix & | labels1 () |
Returns a reference to the first part of the labels matrix. More... | |
const GMatrix & | labels2 () |
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 |
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 | ( | ) |
|
inline |
Returns a reference to the first part of the features matrix.
|
inline |
Returns a reference to the second part of the features matrix.
|
inline |
Returns a reference to the first part of the labels matrix.
|
inline |
returns a reference to the second part of the labels matrix
|
protected |
|
protected |
|
protected |
|
protected |