AdaBoostLearner Class Reference

The AdaBoost learner. More...

#include <AdaBoostMHLearner.h>

List of all members.

Public Member Functions

 AdaBoostLearner (nor_utils::Args &args, int verbose=1)
 The constructor.
void run (int numIterations, const string &trainFileName, const string &testFileName="")
 Start the learning process.

Protected Member Functions

double updateWeights (InputData *pTrainData, BaseLearner *pWeakHypothesis)
 Updates the weights of the examples.

Protected Attributes

vector< BaseLearner * > _foundHypotheses
 The list of the hypotheses found.
InputData_pTrainData
 A pointer to the training data.
InputData_pTestData
 A pointer to the test data (if exists).
string _basicLearnerName
 The name of the basic learner used by AdaBoost.
string _shypFileName
 File name of the strong hypothesis.
int _maxTime
 Time limit for the whole processing. Default: no time limit (-1).
double _theta
 the value of theta. Default = 0.
nor_utils::Args_args
 The arguments defined by the user.
int _verbose
 Verbose level.
string _outputInfoFile
 The filename of the step-by-step information file that will be updated.
const double _smallVal
 A small value, to solve numeric issues.


Detailed Description

The AdaBoost learner.

This class performs the meta-learning by calling the weak learners and updating the weights.

Date:
12/11/2005

Definition at line 47 of file AdaBoostMHLearner.h.


Constructor & Destructor Documentation

AdaBoostLearner nor_utils::Args args,
int  verbose = 1
 

The constructor.

It initializes the variable and set them using the information provided by the arguments passed. They are parsed using the helpers provided by class Params.

Parameters:
args The arguments defined by the user in the command line.
verbose The level of verbosity.
Date:
13/11/2005

Definition at line 40 of file AdaBoostMHLearner.cpp.

References AdaBoostLearner::_basicLearnerName, AdaBoostLearner::_outputInfoFile, Args::getValue(), Args::hasArgument(), and BaseLearner::RegisteredLearners().


Member Function Documentation

void run int  numIterations,
const string &  trainFileName,
const string &  testFileName = ""
 

Start the learning process.

Parameters:
numIterations The number of iterations.
trainFileName The name of the file with the training data.
testFileName Optional: The name of the file with the testing data. Used for step-by-step evaluation.
See also:
OutputInfo
Date:
10/11/2005

Definition at line 96 of file AdaBoostMHLearner.cpp.

References AdaBoostLearner::_args, AdaBoostLearner::_basicLearnerName, AdaBoostLearner::_shypFileName, AdaBoostLearner::_verbose, BaseLearner::createInputData(), InputData::initOptions(), MultiBoost::IT_TEST, MultiBoost::IT_TRAIN, InputData::load(), and BaseLearner::RegisteredLearners().

double updateWeights InputData pTrainData,
BaseLearner pWeakHypothesis
[protected]
 

Updates the weights of the examples.

The re-weighting of $w$ (the weight vector over all the examples and classes) is done using the following formula

\[ w^{(t+1)}_{i, \ell}= \frac{ w^{(t)}_{i, \ell} \exp \left( -\alpha^{(t)} h_\ell^{(t)}(x_i) y_{i, \ell} \right) }{ Z^{(t)} } \]

where Z is a normalization factor, and it is defined as

\[ Z^{(t)} = \sum_{j=1}^n \sum_{\ell=1}^k w^{(t)}_{j, \ell} \exp \left( -\alpha^{(t)} h_\ell^{(t)}(x_j) y_{j, \ell} \right) \]

where $n$ is the number of examples, $k$ the number of classes, $\alpha$ is the confidence in the weak classifier, $h_\ell(x_i)$ is the classification of example $x_i$ for class $\ell$ with the classifier found at the current iteration (see BaseLearner::classify()), and $y_i$ is the binary label of that example, defined in InputData::getBinaryClass().

Parameters:
pTrainData The pointer to the training data.
pWeakHypothesis The current weak hypothesis.
Returns:
The value of the edge. It will be used to see if the algorithm can continue with learning.
Date:
16/11/2005

Definition at line 207 of file AdaBoostMHLearner.cpp.

References BaseLearner::classify(), BaseLearner::getAlpha(), InputData::getBinaryClass(), ClassMappings::getNumClasses(), InputData::getNumExamples(), InputData::getWeight(), and InputData::setWeight().


Member Data Documentation

int _verbose [protected]
 

Verbose level.

There are three levels of verbosity:

  • 0 = no messages
  • 1 = basic messages
  • 2 = show all messages

Definition at line 123 of file AdaBoostMHLearner.h.

Referenced by AdaBoostLearner::run().


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