MultiStumpLearner Class Reference

A multi threshold decision stump learner. More...

#include <MultiStumpLearner.h>

Inheritance diagram for MultiStumpLearner:

StumpLearner BaseLearner List of all members.

Public Member Functions

virtual BaseLearnercreate ()
 Returns itself as object.
virtual void run (InputData *pData)
 Run the learner to build the classifier on the given data.
virtual void save (ofstream &outputStream, const int numTabs=0)
 Save the current object information needed for classification, that is the threshold list.
virtual void load (nor_utils::StreamTokenizer &st)
 Load the xml file that contains the serialized information needed for the classification and that belongs to this class.

Private Member Functions

virtual char phi (double val, int classIdx)
 A discriminative function.
virtual void findThresholds (InputData *pData, const int columnIdx, vector< double > &thresholds, vector< sRates > &mu, vector< char > &v)
 Find the thresholds (one for each class) for column columnIndex.

Private Attributes

vector< double > _thresholds
 The thresholds (one for each class) of the decision stump.

Detailed Description

A multi threshold decision stump learner.

There is a threshold for every class.

Definition at line 50 of file MultiStumpLearner.h.


Member Function Documentation

virtual BaseLearner* create  )  [inline, virtual]
 

Returns itself as object.

Remarks:
It uses the trick described in http://www.parashift.com/c++-faq-lite/serialization.html#faq-36.8 for the auto-registering classes.
Date:
14/11/2005

Implements BaseLearner.

Definition at line 60 of file MultiStumpLearner.h.

void findThresholds InputData pData,
const int  columnIdx,
vector< double > &  thresholds,
vector< sRates > &  mu,
vector< char > &  v
[private, virtual]
 

Find the thresholds (one for each class) for column columnIndex.

Parameters:
pData The pointer to the data
columnIdx The index of the data column
thresholds The thresholds to update
mu The The class-wise rates to update
v The alignment vector to update
See also:
StumpLearner::sMu

run

_thresholds

Date:
11/11/2005

Definition at line 101 of file MultiStumpLearner.cpp.

References StumpLearner::_bestErrors, StumpLearner::_halfWeightsPerClass, StumpLearner::_leftErrors, StumpLearner::_rightErrors, BaseLearner::_smallVal, StumpLearner::_weightsPerClass, InputData::getClass(), ClassMappings::getNumClasses(), and InputData::getWeight().

void load nor_utils::StreamTokenizer st  )  [virtual]
 

Load the xml file that contains the serialized information needed for the classification and that belongs to this class.

Parameters:
st The stream tokenizer that returns tags and values as tokens
See also:
save()
Date:
13/11/2005

Reimplemented from StumpLearner.

Definition at line 265 of file MultiStumpLearner.cpp.

References MultiStumpLearner::_thresholds, StumpLearner::load(), and UnSerialization::seekAndParseVectorTag().

char phi double  val,
int  classIdx
[private, virtual]
 

A discriminative function.

Remarks:
Positive or negative do NOT refer to positive or negative classification. This function is equivalent to the phi function in my thesis.
Parameters:
val The value to discriminate
classIdx The index of the class
Returns:
+1 if val is on one side of the border for classIdx and -1 otherwise
Date:
11/11/2005
See also:
classify

Implements StumpLearner.

Definition at line 91 of file MultiStumpLearner.cpp.

References MultiStumpLearner::_thresholds.

void run InputData pData  )  [virtual]
 

Run the learner to build the classifier on the given data.

Parameters:
pData The pointer to the data
See also:
BaseLearner::run
Date:
11/11/2005

Implements BaseLearner.

Definition at line 38 of file MultiStumpLearner.cpp.

References ClassMappings::getNumClasses().

void save ofstream &  outputStream,
const int  numTabs = 0
[virtual]
 

Save the current object information needed for classification, that is the threshold list.

Parameters:
outputStream The stream where the data will be saved
numTabs The number of tabs before the tag. Useful for indentation
Remarks:
To fully save the object it is very important to call also the super-class method.
See also:
StumpLearner::save()
Date:
13/11/2005

Reimplemented from StumpLearner.

Definition at line 254 of file MultiStumpLearner.cpp.

References MultiStumpLearner::_thresholds, StumpLearner::save(), and Serialization::vectorTag().


The documentation for this class was generated from the following files:
Generated on Mon Nov 28 21:43:48 2005 for MultiBoost by  doxygen 1.4.5