19 #include "drwnClassifier.h"
20 #include "drwnDecisionTree.h"
26 typedef enum _drwnBoostingMethod {
27 DRWN_BOOST_DISCRETE, DRWN_BOOST_GENTLE, DRWN_BOOST_REAL
92 virtual const char *
type()
const {
return "drwnBoostedClassifier"; }
96 virtual void initialize(
unsigned n,
unsigned k = 2);
99 virtual bool save(drwnXMLNode& node)
const;
100 virtual bool load(drwnXMLNode& node);
110 void pruneRounds(
unsigned numRounds);
114 virtual void getClassScores(
const vector<double>& features,
115 vector<double>& outputScores)
const;
virtual double train(const drwnClassifierDataset &dataset)=0
train the parameters of the classifier from a drwnClassifierDataset object
int _numRounds
number of rounds of boosting
Definition: drwnBoostedClassifier.h:73
vector< drwnDecisionTree * > _weakLearners
weak learners
Definition: drwnBoostedClassifier.h:78
static double SHRINKAGE
boosting shrinkage
Definition: drwnBoostedClassifier.h:68
vector< double > _alphas
weight for each weak learner
Definition: drwnBoostedClassifier.h:80
virtual drwnBoostedClassifier * clone() const
returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); } ...
Definition: drwnBoostedClassifier.h:93
static int NUM_ROUNDS
maximum number of boosting rounds
Definition: drwnBoostedClassifier.h:66
static drwnBoostingMethod METHOD
controls the re-weighting of data samples at the end of each training iteration
Definition: drwnBoostedClassifier.h:65
Implements a mult-class boosted decision-tree classifier. See Zhu et al., Multi-class AdaBoost...
Definition: drwnBoostedClassifier.h:61
double _shrinkage
boosting shrinkage
Definition: drwnBoostedClassifier.h:75
Implements the interface for a generic machine learning classifier.
Definition: drwnClassifier.h:31
drwnBoostingMethod _method
boosting method
Definition: drwnBoostedClassifier.h:72
virtual const char * type() const
returns object type as a string (e.g., Foo::type() { return "Foo"; })
Definition: drwnBoostedClassifier.h:92
Implements a cacheable dataset containing feature vectors, labels and optional weights.
Definition: drwnDataset.h:43
virtual void getClassScores(const vector< double > &features, vector< double > &outputScores) const =0
compute the unnormalized log-probability for a single feature vector
int _maxDepth
maximum depth of each decision tree
Definition: drwnBoostedClassifier.h:74
static int MAX_DEPTH
maximum depth of each decision tree
Definition: drwnBoostedClassifier.h:67