Package moa.classifiers.trees
Class ASHoeffdingTree
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.trees.HoeffdingTree
-
- moa.classifiers.trees.ASHoeffdingTree
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class ASHoeffdingTree extends HoeffdingTree
Adaptive Size Hoeffding Tree used in Bagging using trees of different size. The Adaptive-Size Hoeffding Tree (ASHT) is derived from the Hoeffding Tree algorithm with the following differences:- it has a maximum number of split nodes, or size
- after one node splits, if the number of split nodes of the ASHT tree is higher than the maximum value, then it deletes some nodes to reduce its size
- delete the oldest node, the root, and all of its children except the one where the split has been made. After that, the root of the child not deleted becomes the new root
- delete all the nodes of the tree, i.e., restart from a new root.
With this new method, it is attempted to improve bagging performance by increasing tree diversity. It has been observed that boosting tends to produce a more diverse set of classifiers than bagging, and this has been cited as a factor in increased performance.
See more details in:
Albert Bifet, Geoff Holmes, Bernhard Pfahringer, Richard Kirkby, and Ricard Gavaldà. New ensemble methods for evolving data streams. In 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2009.
The learner must be ASHoeffdingTree, a Hoeffding Tree with a maximum size value.
Example:
OzaBagASHT -l ASHoeffdingTree -s 10 -u -r
Parameters:- Same parameters as
OzaBag
- -f : the size of first classifier in the bag.
- -u : Enable weight classifiers
- -r : Reset trees when size is higher than the max
- Version:
- $Revision: 7 $
- Author:
- Albert Bifet (abifet at cs dot waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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
maxSize
protected boolean
resetTree
-
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 ASHoeffdingTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteNode(HoeffdingTree.Node node, int childIndex)
String
getPurposeString()
Dictionary with option texts and objectsvoid
resetLearningImpl()
Resets this classifier.void
resizeTree(HoeffdingTree.Node node, int childIndex)
void
setMaxSize(int mSize)
void
setResetTree()
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, defineImmutableCapabilities, enforceTrackerLimit, estimateModelByteSizes, findLearningNodes, findLearningNodes, getModelDescription, getModelMeasurementsImpl, getNodeCount, getTreeRoot, getVotesForInstance, isRandomizable, measureByteSize, measureTreeDepth, newLearningNode, newLearningNode, newNominalClassObserver, newNumericClassObserver, newSplitNode, newSplitNode
-
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
-
resetLearningImpl
public void resetLearningImpl()
Description copied from class:AbstractClassifier
Resets this classifier. It must be similar to starting a new classifier from scratch.
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:
resetLearningImpl
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
-
setMaxSize
public void setMaxSize(int mSize)
-
setResetTree
public void setResetTree()
-
deleteNode
public void deleteNode(HoeffdingTree.Node node, int childIndex)
-
resizeTree
public void resizeTree(HoeffdingTree.Node node, int childIndex)
-
-