#include <MultipleClassifiers.hh>
Public Member Functions | |
virtual float | getConf (const std::vector< float > &s) |
virtual MultipleClassifiers * | getCopy () |
void | initModels () |
float | klDivergence (const std::vector< float > &input) |
MultipleClassifiers (int id, int modelType, int predType, int nModels, int trainMode, int trainFreq, float featPct, float expPct, float treeThreshold, bool stoch, float featRange, Random rng) | |
MultipleClassifiers (const MultipleClassifiers &) | |
virtual void | testInstance (const std::vector< float > &input, std::map< float, float > *retval) |
virtual bool | trainInstance (classPair &instance) |
virtual bool | trainInstances (std::vector< classPair > &instances) |
void | updateModelAccuracy (int i, const std::vector< float > &input, float out) |
float | variance (const std::vector< float > &input) |
~MultipleClassifiers () | |
Public Attributes | |
bool | ACC_DEBUG |
bool | CONF_DEBUG |
bool | COPYDEBUG |
std::vector< Classifier * > | models |
bool | PRED_DEBUG |
bool | STDEBUG |
Private Attributes | |
std::vector< float > | accuracy |
const bool | addNoise |
float | expPct |
float | featPct |
const float | featRange |
const int | freq |
const int | id |
std::vector< std::map< float, float > > | infos |
const int | mode |
const int | modelType |
const int | nModels |
int | nsteps |
const int | predType |
Random | rng |
const bool | stoch |
const float | treeThresh |
Multiple Classifiers class: uses an ensemble of classifiers, such as a set of decision trees in a random forest
Definition at line 22 of file MultipleClassifiers.hh.
MultipleClassifiers::MultipleClassifiers | ( | int | id, |
int | modelType, | ||
int | predType, | ||
int | nModels, | ||
int | trainMode, | ||
int | trainFreq, | ||
float | featPct, | ||
float | expPct, | ||
float | treeThreshold, | ||
bool | stoch, | ||
float | featRange, | ||
Random | rng | ||
) |
Default Constructor
id | identify the model |
modelType | identifies which type of model to use |
predType | identifies how to combine multiple models |
nModels | # of models to use for ensemble models (i.e. random forests) |
trainMode | build every step? only on errors? every freq steps? |
trainFreq | frequency of model building if using latter mode |
featPct | pct of features to remove from set used for each tree split |
expPct | pct of experiences to give to each model |
treeThreshold | determines the amount of error to be tolerated in the tree (prevents over-fitting with larger and larger trees) |
stoch | if the domain is stochastic or deterministic |
rng | Random Number Generator |
Definition at line 10 of file MultipleClassifiers.cc.
Copy constructor
Definition at line 41 of file MultipleClassifiers.cc.
Definition at line 77 of file MultipleClassifiers.cc.
float MultipleClassifiers::getConf | ( | const std::vector< float > & | s | ) | [virtual] |
Implements Classifier.
Definition at line 290 of file MultipleClassifiers.cc.
MultipleClassifiers * MultipleClassifiers::getCopy | ( | ) | [virtual] |
Implements Classifier.
Definition at line 70 of file MultipleClassifiers.cc.
void MultipleClassifiers::initModels | ( | ) |
Initialize models
Definition at line 406 of file MultipleClassifiers.cc.
float MultipleClassifiers::klDivergence | ( | const std::vector< float > & | input | ) |
Calculate kl divergence of the model's predicted probability distributions
Definition at line 329 of file MultipleClassifiers.cc.
void MultipleClassifiers::testInstance | ( | const std::vector< float > & | input, |
std::map< float, float > * | retval | ||
) | [virtual] |
Implements Classifier.
Definition at line 186 of file MultipleClassifiers.cc.
bool MultipleClassifiers::trainInstance | ( | classPair & | instance | ) | [virtual] |
Implements Classifier.
Definition at line 145 of file MultipleClassifiers.cc.
bool MultipleClassifiers::trainInstances | ( | std::vector< classPair > & | instances | ) | [virtual] |
Implements Classifier.
Definition at line 87 of file MultipleClassifiers.cc.
void MultipleClassifiers::updateModelAccuracy | ( | int | i, |
const std::vector< float > & | input, | ||
float | out | ||
) |
Update measure of accuracy for model if we're using best model only
Definition at line 455 of file MultipleClassifiers.cc.
float MultipleClassifiers::variance | ( | const std::vector< float > & | input | ) |
Calculate the variance of the model's predictions of continuous values
Definition at line 385 of file MultipleClassifiers.cc.
Definition at line 69 of file MultipleClassifiers.hh.
std::vector<float> MultipleClassifiers::accuracy [private] |
Definition at line 93 of file MultipleClassifiers.hh.
const bool MultipleClassifiers::addNoise [private] |
Definition at line 88 of file MultipleClassifiers.hh.
Definition at line 70 of file MultipleClassifiers.hh.
Definition at line 71 of file MultipleClassifiers.hh.
float MultipleClassifiers::expPct [private] |
Definition at line 85 of file MultipleClassifiers.hh.
float MultipleClassifiers::featPct [private] |
Definition at line 84 of file MultipleClassifiers.hh.
const float MultipleClassifiers::featRange [private] |
Definition at line 89 of file MultipleClassifiers.hh.
const int MultipleClassifiers::freq [private] |
Definition at line 83 of file MultipleClassifiers.hh.
const int MultipleClassifiers::id [private] |
Definition at line 78 of file MultipleClassifiers.hh.
std::vector<std::map<float, float> > MultipleClassifiers::infos [private] |
Definition at line 95 of file MultipleClassifiers.hh.
const int MultipleClassifiers::mode [private] |
Definition at line 82 of file MultipleClassifiers.hh.
std::vector<Classifier*> MultipleClassifiers::models |
The ensemble of Classifier Models used.
Definition at line 74 of file MultipleClassifiers.hh.
const int MultipleClassifiers::modelType [private] |
Definition at line 79 of file MultipleClassifiers.hh.
const int MultipleClassifiers::nModels [private] |
Definition at line 81 of file MultipleClassifiers.hh.
int MultipleClassifiers::nsteps [private] |
Definition at line 94 of file MultipleClassifiers.hh.
Definition at line 68 of file MultipleClassifiers.hh.
const int MultipleClassifiers::predType [private] |
Definition at line 80 of file MultipleClassifiers.hh.
Random MultipleClassifiers::rng [private] |
Definition at line 91 of file MultipleClassifiers.hh.
Definition at line 67 of file MultipleClassifiers.hh.
const bool MultipleClassifiers::stoch [private] |
Definition at line 87 of file MultipleClassifiers.hh.
const float MultipleClassifiers::treeThresh [private] |
Definition at line 86 of file MultipleClassifiers.hh.