#include <AdaBoost.h>
Inheritance diagram for PLearn::AdaBoost:
Public Types | |
typedef PLearner | inherited |
Public Member Functions | |
AdaBoost () | |
virtual void | build () |
simply calls inherited::build() then build_() | |
virtual void | makeDeepCopyFromShallowCopy (map< const void *, void * > &copies) |
Transforms a shallow copy into a deep copy. | |
PLEARN_DECLARE_OBJECT (AdaBoost) | |
virtual int | outputsize () const |
returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options) This implementation of AdaBoost always performs two-class classification, hence returns 1 | |
virtual void | forget () |
(Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!) | |
virtual void | train () |
The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process. | |
virtual void | computeOutput (const Vec &input, Vec &output) const |
Computes the output from the input. | |
virtual void | computeCostsFromOutputs (const Vec &input, const Vec &output, const Vec &target, Vec &costs) const |
Computes the costs from already computed output. | |
virtual TVec< string > | getTestCostNames () const |
Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method). | |
virtual TVec< string > | getTrainCostNames () const |
Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats. | |
Public Attributes | |
PP< PLearner > | weak_learner_template |
Weak learner to use as a template for each boosting round. | |
real | target_error |
bool | provide_learner_expdir |
real | output_threshold |
bool | compute_training_error |
bool | pseudo_loss_adaboost |
bool | weight_by_resampling |
bool | early_stopping |
bool | save_often |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Protected Attributes | |
Vec | learners_error |
Vec | example_weights |
Vec | voting_weights |
real | sum_voting_weights |
real | initial_sum_weights |
TVec< PP< PLearner > > | weak_learners |
Vector of weak learners learned from boosting. | |
Private Member Functions | |
void | build_ () |
This does the actual building. |
|
Reimplemented from PLearn::PLearner. Definition at line 54 of file AdaBoost.h. |
|
Definition at line 52 of file AdaBoost.cc. |
|
simply calls inherited::build() then build_()
Reimplemented from PLearn::PLearner. Definition at line 132 of file AdaBoost.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::PLearner. Definition at line 127 of file AdaBoost.cc. Referenced by build(). |
|
Computes the costs from already computed output.
Implements PLearn::PLearner. Definition at line 383 of file AdaBoost.cc. References output_threshold, PLERROR, PLearn::TVec< T >::resize(), and PLearn::TVec< T >::size(). |
|
Computes the output from the input.
Implements PLearn::PLearner. Definition at line 370 of file AdaBoost.cc. References PLearn::TVec< T >::length(), PLearn::TVec< T >::resize(), sum_voting_weights, voting_weights, and weak_learners. |
|
Declares this class' options.
Reimplemented from PLearn::PLearner. Definition at line 71 of file AdaBoost.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
(Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!)
Implements PLearn::PLearner. Definition at line 157 of file AdaBoost.cc. References learners_error, PLearn::manual_seed(), PLearn::TVec< PP< PLearner > >::resize(), PLearn::TVec< T >::resize(), PLearn::seed(), sum_voting_weights, voting_weights, and weak_learners. Referenced by train(). |
|
Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).
Implements PLearn::PLearner. Definition at line 403 of file AdaBoost.cc. References getTrainCostNames(). |
|
Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.
Implements PLearn::PLearner. Definition at line 408 of file AdaBoost.cc. Referenced by getTestCostNames(). |
|
Transforms a shallow copy into a deep copy.
Definition at line 139 of file AdaBoost.cc. References PLearn::deepCopyField(), example_weights, learners_error, voting_weights, weak_learner_template, and weak_learners. |
|
returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options) This implementation of AdaBoost always performs two-class classification, hence returns 1
Implements PLearn::PLearner. Definition at line 151 of file AdaBoost.cc. |
|
|
|
|
Definition at line 99 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 108 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 62 of file AdaBoost.h. Referenced by makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 72 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 60 of file AdaBoost.h. Referenced by forget(), makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 96 of file AdaBoost.h. Referenced by computeCostsFromOutputs(), and train(). |
|
Definition at line 93 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 102 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 111 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 71 of file AdaBoost.h. Referenced by computeOutput(), forget(), and train(). |
|
Definition at line 90 of file AdaBoost.h. Referenced by train(). |
|
Definition at line 70 of file AdaBoost.h. Referenced by computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train(). |
|
Weak learner to use as a template for each boosting round. AdaBoost requires classification weak-learners that provide an essential non-linearity (e.g. linear regression does not work) NOTE: this weak learner must support deepCopy(). Definition at line 87 of file AdaBoost.h. Referenced by makeDeepCopyFromShallowCopy(), and train(). |
|
Vector of weak learners learned from boosting.
Definition at line 75 of file AdaBoost.h. Referenced by computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 105 of file AdaBoost.h. Referenced by train(). |