GClasses
|
Generates subsets of data that contain only the most relevant features for predicting the labels. The train method of this class produces a ranked ordering of the feature attributes by training a single-layer neural network, and deselecting the weakest attribute until all attributes have been deselected. The transform method uses only the highest-ranked attributes. More...
#include <GTransform.h>
Public Member Functions | |
GAttributeSelector (size_t labelDims, size_t targetFeatures, GRand *pRand) | |
GAttributeSelector (GDomNode *pNode, GLearnerLoader &ll) | |
virtual | ~GAttributeSelector () |
virtual GDomNode * | serialize (GDom *pDoc) |
Marshal this object into a DOM, which can then be converted to a variety of serial formats. | |
virtual void | train (GMatrix &data) |
See the comment for GIncrementalTransform::train. | |
virtual void | transform (const double *pIn, double *pOut) |
See the comment for GIncrementalTransform::transform. | |
void | setTargetFeatures (size_t n) |
Specifies the number of features to select. | |
std::vector< size_t > & | ranks () |
Returns a list of attributes in ranked-order. Most important attributes are first. Weakest attributes are last. (The results are undefined until after train is called.) | |
Static Public Member Functions | |
static void | test () |
Protected Attributes | |
size_t | m_labelDims |
size_t | m_targetFeatures |
std::vector< size_t > | m_ranks |
GRand * | m_pRand |
Generates subsets of data that contain only the most relevant features for predicting the labels. The train method of this class produces a ranked ordering of the feature attributes by training a single-layer neural network, and deselecting the weakest attribute until all attributes have been deselected. The transform method uses only the highest-ranked attributes.
GClasses::GAttributeSelector::GAttributeSelector | ( | size_t | labelDims, |
size_t | targetFeatures, | ||
GRand * | pRand | ||
) | [inline] |
GClasses::GAttributeSelector::GAttributeSelector | ( | GDomNode * | pNode, |
GLearnerLoader & | ll | ||
) |
virtual GClasses::GAttributeSelector::~GAttributeSelector | ( | ) | [inline, virtual] |
std::vector<size_t>& GClasses::GAttributeSelector::ranks | ( | ) | [inline] |
Returns a list of attributes in ranked-order. Most important attributes are first. Weakest attributes are last. (The results are undefined until after train is called.)
Marshal this object into a DOM, which can then be converted to a variety of serial formats.
Implements GClasses::GIncrementalTransform.
void GClasses::GAttributeSelector::setTargetFeatures | ( | size_t | n | ) |
Specifies the number of features to select.
static void GClasses::GAttributeSelector::test | ( | ) | [static] |
virtual void GClasses::GAttributeSelector::train | ( | GMatrix & | data | ) | [virtual] |
See the comment for GIncrementalTransform::train.
Implements GClasses::GIncrementalTransform.
virtual void GClasses::GAttributeSelector::transform | ( | const double * | pIn, |
double * | pOut | ||
) | [virtual] |
See the comment for GIncrementalTransform::transform.
Implements GClasses::GIncrementalTransform.
size_t GClasses::GAttributeSelector::m_labelDims [protected] |
GRand* GClasses::GAttributeSelector::m_pRand [protected] |
std::vector<size_t> GClasses::GAttributeSelector::m_ranks [protected] |
size_t GClasses::GAttributeSelector::m_targetFeatures [protected] |