GClasses

GClasses::GAttributeSelector Class Reference

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>

Inheritance diagram for GClasses::GAttributeSelector:
GClasses::GIncrementalTransform GClasses::GTransform

List of all members.

Public Member Functions

 GAttributeSelector (size_t labelDims, size_t targetFeatures, GRand *pRand)
 GAttributeSelector (GDomNode *pNode, GLearnerLoader &ll)
virtual ~GAttributeSelector ()
virtual GDomNodeserialize (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
GRandm_pRand

Detailed Description

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.


Constructor & Destructor Documentation

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]

Member Function Documentation

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.)

virtual GDomNode* GClasses::GAttributeSelector::serialize ( GDom pDoc) [virtual]

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]
virtual void GClasses::GAttributeSelector::transform ( const double *  pIn,
double *  pOut 
) [virtual]

Member Data Documentation

std::vector<size_t> GClasses::GAttributeSelector::m_ranks [protected]