Package moa.classifiers.trees
Class HoeffdingAdaptiveTree
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.trees.HoeffdingTree
-
- moa.classifiers.trees.HoeffdingAdaptiveTree
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
- Direct Known Subclasses:
HoeffdingAdaptiveTreeClassifLeaves
public class HoeffdingAdaptiveTree extends HoeffdingTree
Hoeffding Adaptive Tree for evolving data streams.This adaptive Hoeffding Tree uses ADWIN to monitor performance of branches on the tree and to replace them with new branches when their accuracy decreases if the new branches are more accurate.
See details in:Adaptive Learning from Evolving Data Streams. Albert Bifet, Ricard Gavaldà . IDA 2009
- Same parameters as
HoeffdingTreeNBAdaptive
- -l : Leaf prediction to use: MajorityClass (MC), Naive Bayes (NB) or NaiveBayes adaptive (NBAdaptive).
- Version:
- $Revision: 7 $
- Author:
- Albert Bifet (abifet at cs dot waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HoeffdingAdaptiveTree.AdaLearningNode
static class
HoeffdingAdaptiveTree.AdaSplitNode
static interface
HoeffdingAdaptiveTree.NewNode
-
Nested classes/interfaces inherited from class moa.classifiers.trees.HoeffdingTree
HoeffdingTree.ActiveLearningNode, HoeffdingTree.FoundNode, HoeffdingTree.InactiveLearningNode, HoeffdingTree.LearningNode, HoeffdingTree.LearningNodeNB, HoeffdingTree.LearningNodeNBAdaptive, HoeffdingTree.Node, HoeffdingTree.SplitNode
-
-
Field Summary
Fields Modifier and Type Field Description protected int
alternateTrees
protected int
prunedAlternateTrees
protected int
switchedAlternateTrees
-
Fields inherited from class moa.classifiers.trees.HoeffdingTree
activeLeafByteSizeEstimate, activeLeafNodeCount, binarySplitsOption, byteSizeEstimateOverheadFraction, decisionNodeCount, gracePeriodOption, growthAllowed, inactiveLeafByteSizeEstimate, inactiveLeafNodeCount, leafpredictionOption, maxByteSizeOption, memoryEstimatePeriodOption, nbThresholdOption, nominalEstimatorOption, noPrePruneOption, numericEstimatorOption, removePoorAttsOption, splitConfidenceOption, splitCriterionOption, stopMemManagementOption, tieThresholdOption, treeRoot
-
Fields inherited from class moa.classifiers.AbstractClassifier
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description HoeffdingAdaptiveTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableCapabilities
defineImmutableCapabilities()
Defines the set of capabilities the object has.HoeffdingTree.FoundNode[]
filterInstanceToLeaves(Instance inst, HoeffdingTree.SplitNode parent, int parentBranch, boolean updateSplitterCounts)
String
getPurposeString()
Dictionary with option texts and objectsdouble[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.protected HoeffdingTree.LearningNode
newLearningNode(double[] initialClassObservations)
protected HoeffdingTree.SplitNode
newSplitNode(InstanceConditionalTest splitTest, double[] classObservations)
protected HoeffdingTree.SplitNode
newSplitNode(InstanceConditionalTest splitTest, double[] classObservations, int size)
void
trainOnInstanceImpl(Instance inst)
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.-
Methods inherited from class moa.classifiers.trees.HoeffdingTree
activateLearningNode, attemptToSplit, calcByteSize, computeHoeffdingBound, deactivateAllLeaves, deactivateLearningNode, enforceTrackerLimit, estimateModelByteSizes, findLearningNodes, findLearningNodes, getModelDescription, getModelMeasurementsImpl, getNodeCount, getTreeRoot, isRandomizable, measureByteSize, measureTreeDepth, newLearningNode, newNominalClassObserver, newNumericClassObserver, resetLearningImpl
-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getSubClassifiers, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance, trainOnInstance
-
Methods inherited from class moa.options.AbstractOptionHandler
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Method Detail
-
getPurposeString
public String getPurposeString()
Description copied from class:AbstractOptionHandler
Dictionary with option texts and objects- Specified by:
getPurposeString
in interfaceOptionHandler
- Overrides:
getPurposeString
in classHoeffdingTree
- Returns:
- the string with the purpose of this object
-
newLearningNode
protected HoeffdingTree.LearningNode newLearningNode(double[] initialClassObservations)
- Overrides:
newLearningNode
in classHoeffdingTree
-
newSplitNode
protected HoeffdingTree.SplitNode newSplitNode(InstanceConditionalTest splitTest, double[] classObservations, int size)
- Overrides:
newSplitNode
in classHoeffdingTree
-
newSplitNode
protected HoeffdingTree.SplitNode newSplitNode(InstanceConditionalTest splitTest, double[] classObservations)
- Overrides:
newSplitNode
in classHoeffdingTree
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance inst)
Description copied from class:AbstractClassifier
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. Note that this will produce compiler errors if not overridden.- Overrides:
trainOnInstanceImpl
in classHoeffdingTree
- Parameters:
inst
- the instance to be used for training
-
filterInstanceToLeaves
public HoeffdingTree.FoundNode[] filterInstanceToLeaves(Instance inst, HoeffdingTree.SplitNode parent, int parentBranch, boolean updateSplitterCounts)
-
getVotesForInstance
public double[] getVotesForInstance(Instance inst)
Description copied from interface:Classifier
Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero.- Specified by:
getVotesForInstance
in interfaceClassifier
- Overrides:
getVotesForInstance
in classHoeffdingTree
- Parameters:
inst
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
defineImmutableCapabilities
public ImmutableCapabilities defineImmutableCapabilities()
Description copied from interface:CapabilitiesHandler
Defines the set of capabilities the object has. Should be overridden if the object's capabilities do not change.- Specified by:
defineImmutableCapabilities
in interfaceCapabilitiesHandler
- Overrides:
defineImmutableCapabilities
in classHoeffdingTree
- Returns:
- The capabilities of the object.
-
-