public class AdaptiveRandomForest extends AbstractClassifier implements MultiClassClassifier
Adaptive Random Forest (ARF). The 3 most important aspects of this ensemble classifier are: (1) inducing diversity through resampling; (2) inducing diversity through randomly selecting subsets of features for node splits (See moa.classifiers.trees.ARFHoeffdingTree.java); (3) drift detectors per base tree, which cause selective resets in response to drifts. It also allows training background trees, which start training if a warning is detected and replace the active tree if the warning escalates to a drift.
See details in:
Heitor Murilo Gomes, Albert Bifet, Jesse Read,
Jean Paul Barddal, Fabricio Enembreck, Bernhard Pfharinger, Geoff Holmes,
Talel Abdessalem. Adaptive random forests for evolving data stream classification.
In Machine Learning, DOI: 10.1007/s10994-017-5642-8, Springer, 2017.
Parameters:
Modifier and Type | Class and Description |
---|---|
protected class |
AdaptiveRandomForest.ARFBaseLearner
Inner class that represents a single tree member of the forest.
|
protected class |
AdaptiveRandomForest.TrainingRunnable
Inner class to assist with the multi-thread execution.
|
Modifier and Type | Field and Description |
---|---|
FlagOption |
disableBackgroundLearnerOption |
FlagOption |
disableDriftDetectionOption |
FlagOption |
disableWeightedVote |
ClassOption |
driftDetectionMethodOption |
protected AdaptiveRandomForest.ARFBaseLearner[] |
ensemble |
IntOption |
ensembleSizeOption |
protected BasicClassificationPerformanceEvaluator |
evaluator |
protected static int |
FEATURES_M |
protected static int |
FEATURES_PERCENT |
protected static int |
FEATURES_SQRT |
protected static int |
FEATURES_SQRT_INV |
protected long |
instancesSeen |
FloatOption |
lambdaOption |
MultiChoiceOption |
mFeaturesModeOption |
IntOption |
mFeaturesPerTreeSizeOption |
IntOption |
numberOfJobsOption |
protected static int |
SINGLE_THREAD |
protected int |
subspaceSize |
ClassOption |
treeLearnerOption |
ClassOption |
warningDetectionMethodOption |
classifierRandom, downSampleRatio, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
config
Constructor and Description |
---|
AdaptiveRandomForest() |
Modifier and Type | Method and Description |
---|---|
void |
getModelDescription(StringBuilder arg0,
int arg1)
Returns a string representation of the model.
|
protected Measurement[] |
getModelMeasurementsImpl()
Gets the current measurements of this classifier.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. |
String |
getPurposeString()
Dictionary with option texts and objects
|
Classifier[] |
getSubClassifiers()
Gets the classifiers of this ensemble.
|
double[] |
getVotesForInstance(Instance instance)
Predicts the class memberships for a given instance.
|
protected void |
initEnsemble(Instance instance) |
boolean |
isRandomizable()
Gets whether this learner needs a random seed.
|
void |
resetLearningImpl()
Resets this classifier.
|
void |
trainOnInstanceImpl(Instance instance)
Trains this classifier incrementally using the given instance.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. |
contextIsCompatible, copy, correctlyClassifies, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getDownSampleRatio, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance, trainOnInstance, updateDownSampleRatio
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCLICreationString, getOptions, prepareForUse, prepareForUse
measureByteSize
public ClassOption treeLearnerOption
public IntOption ensembleSizeOption
public MultiChoiceOption mFeaturesModeOption
public IntOption mFeaturesPerTreeSizeOption
public FloatOption lambdaOption
public IntOption numberOfJobsOption
public ClassOption driftDetectionMethodOption
public ClassOption warningDetectionMethodOption
public FlagOption disableWeightedVote
public FlagOption disableDriftDetectionOption
public FlagOption disableBackgroundLearnerOption
protected static final int FEATURES_M
protected static final int FEATURES_SQRT
protected static final int FEATURES_SQRT_INV
protected static final int FEATURES_PERCENT
protected static final int SINGLE_THREAD
protected AdaptiveRandomForest.ARFBaseLearner[] ensemble
protected long instancesSeen
protected int subspaceSize
protected BasicClassificationPerformanceEvaluator evaluator
public String getPurposeString()
AbstractOptionHandler
getPurposeString
in interface OptionHandler
getPurposeString
in class AbstractClassifier
public void resetLearningImpl()
AbstractClassifier
resetLearningImpl
in class AbstractClassifier
public void trainOnInstanceImpl(Instance instance)
AbstractClassifier
trainOnInstanceImpl
in class AbstractClassifier
instance
- the instance to be used for trainingpublic double[] getVotesForInstance(Instance instance)
Classifier
getVotesForInstance
in interface Classifier
getVotesForInstance
in class AbstractClassifier
instance
- the instance to be classifiedpublic boolean isRandomizable()
Learner
isRandomizable
in interface Learner<Example<Instance>>
public void getModelDescription(StringBuilder arg0, int arg1)
AbstractClassifier
getModelDescription
in class AbstractClassifier
arg0
- the stringbuilder to add the descriptionarg1
- the number of characters to indentprotected Measurement[] getModelMeasurementsImpl()
AbstractClassifier
getModelMeasurementsImpl
in class AbstractClassifier
public Classifier[] getSubClassifiers()
Classifier
getSubClassifiers
in interface Classifier
getSubClassifiers
in class AbstractClassifier
protected void initEnsemble(Instance instance)
Copyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.