Random Forest Classifier. More...
#include <shark/Models/Trees/RFClassifier.h>
Public Member Functions | |
std::string | name () const |
From INameable: return the class name. More... | |
double | OOBerror () const |
Returns the computed out-of-bag-error of the forest. More... | |
RealVector const & | featureImportances () const |
Returns the computed feature importances of the forest. More... | |
UIntVector | countAttributes () const |
Counts how often attributes are used. More... | |
void | computeOOBerror (std::vector< std::vector< std::size_t > > const &oobIndices, LabeledData< RealVector, LabelType > const &data) |
Compute oob error, given an oob dataset (Classification) More... | |
void | computeFeatureImportances (std::vector< std::vector< std::size_t > > const &oobIndices, LabeledData< RealVector, LabelType > const &data, random::rng_type &rng) |
Random Forest Classifier.
Definition at line 154 of file RFClassifier.h.
|
inline |
Compute feature importances, given an oob dataset
For each tree, extracts the out-of-bag-samples indicated by oobIndices. The feature importance is defined as the average change of loss (Squared loss or accuracy depending on label type) when the feature is permuted across the oob samples of a tree.
Definition at line 197 of file RFClassifier.h.
References shark::inputDimension(), and shark::subBatch().
|
inline |
Compute oob error, given an oob dataset (Classification)
Definition at line 184 of file RFClassifier.h.
References shark::LabeledData< InputT, LabelT >::numberOfElements().
|
inline |
Counts how often attributes are used.
Definition at line 173 of file RFClassifier.h.
|
inline |
Returns the computed feature importances of the forest.
Definition at line 168 of file RFClassifier.h.
|
inlinevirtual |
From INameable: return the class name.
Reimplemented from shark::INameable.
Definition at line 158 of file RFClassifier.h.
|
inline |
Returns the computed out-of-bag-error of the forest.
Definition at line 163 of file RFClassifier.h.