Package moa.classifiers.trees
Class ARFFIMTDD
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.trees.ARFFIMTDD
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,Regressor
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class ARFFIMTDD extends AbstractClassifier implements Regressor
Implementation of ARFFIMTDD, an extension of FIMTDD to be used by AdaptiveRandomForestRegressor.See details in:
Heitor Murilo Gomes, Jean Paul Barddal, Luis Eduardo Boiko Ferreira, Albert Bifet. Adaptive random forests for data stream regression. In European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning (ESANN), 2018. https://www.elen.ucl.ac.be/Proceedings/esann/esannpdf/es2018-183.pdfFIMT-DD:
Ikonomovska, Elena, João Gama, and Sašo Džeroski. Learning model trees from evolving data streams. Data mining and knowledge discovery 23.1 (2011): 128-168.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ARFFIMTDD.FIMTDDPerceptron
static class
ARFFIMTDD.InnerNode
static class
ARFFIMTDD.LeafNode
static class
ARFFIMTDD.Node
static class
ARFFIMTDD.SplitNode
-
Field Summary
Fields Modifier and Type Field Description FloatOption
alternateTreeFadingFactorOption
IntOption
alternateTreeTimeOption
IntOption
alternateTreeTMinOption
protected double
examplesSeen
IntOption
gracePeriodOption
protected int
leafNodeCount
FloatOption
learningRateDecayFactorOption
FlagOption
learningRatioConstOption
FloatOption
learningRatioOption
int
maxID
FloatOption
PageHinckleyAlphaOption
IntOption
PageHinckleyThresholdOption
FloatOption
splitConfidenceOption
ClassOption
splitCriterionOption
protected int
splitNodeCount
IntOption
subspaceSizeOption
protected DoubleVector
sumOfAttrSquares
protected DoubleVector
sumOfAttrValues
protected double
sumOfSquares
protected double
sumOfValues
FloatOption
tieThresholdOption
protected ARFFIMTDD.Node
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 ARFFIMTDD()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attemptToSplit(ARFFIMTDD.LeafNode node, ARFFIMTDD.Node parent, int parentIndex)
int
calcByteSize()
protected void
checkRoot()
static double
computeHoeffdingBound(double range, double confidence, double n)
double
computeSD(double squaredVal, double val, double size)
void
getModelDescription(StringBuilder out, int indent)
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.double
getNormalizedError(Instance inst, double prediction)
String
getPurposeString()
Dictionary with option texts and objectsdouble[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.boolean
isRandomizable()
Gets whether this learner needs a random seed.protected ARFFIMTDD.FIMTDDPerceptron
newLeafModel()
protected ARFFIMTDD.LeafNode
newLeafNode()
protected FIMTDDNumericAttributeClassObserver
newNumericClassObserver()
protected ARFFIMTDD.SplitNode
newSplitNode(InstanceConditionalTest splitTest)
double
normalizeTargetValue(double value)
void
processInstance(Instance inst, ARFFIMTDD.Node node, double prediction, double normalError, boolean growthAllowed, boolean inAlternate)
void
resetLearningImpl()
Resets this classifier.double
scalarProduct(DoubleVector u, DoubleVector v)
void
trainOnInstanceImpl(Instance inst)
Method for updating (training) the model using a new instance-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, 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, 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.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
treeRoot
protected ARFFIMTDD.Node treeRoot
-
leafNodeCount
protected int leafNodeCount
-
splitNodeCount
protected int splitNodeCount
-
examplesSeen
protected double examplesSeen
-
sumOfValues
protected double sumOfValues
-
sumOfSquares
protected double sumOfSquares
-
sumOfAttrValues
protected DoubleVector sumOfAttrValues
-
sumOfAttrSquares
protected DoubleVector sumOfAttrSquares
-
maxID
public int maxID
-
subspaceSizeOption
public IntOption subspaceSizeOption
-
splitCriterionOption
public ClassOption splitCriterionOption
-
gracePeriodOption
public IntOption gracePeriodOption
-
splitConfidenceOption
public FloatOption splitConfidenceOption
-
tieThresholdOption
public FloatOption tieThresholdOption
-
PageHinckleyAlphaOption
public FloatOption PageHinckleyAlphaOption
-
PageHinckleyThresholdOption
public IntOption PageHinckleyThresholdOption
-
alternateTreeFadingFactorOption
public FloatOption alternateTreeFadingFactorOption
-
alternateTreeTMinOption
public IntOption alternateTreeTMinOption
-
alternateTreeTimeOption
public IntOption alternateTreeTimeOption
-
learningRatioOption
public FloatOption learningRatioOption
-
learningRateDecayFactorOption
public FloatOption learningRateDecayFactorOption
-
learningRatioConstOption
public FlagOption learningRatioConstOption
-
-
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 classAbstractClassifier
- 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.- Specified by:
resetLearningImpl
in classAbstractClassifier
-
isRandomizable
public boolean isRandomizable()
Description copied from interface:Learner
Gets whether this learner needs a random seed. Examples of methods that needs a random seed are bagging and boosting.- Specified by:
isRandomizable
in interfaceLearner<Example<Instance>>
- Returns:
- true if the learner needs a random seed.
-
getModelDescription
public void getModelDescription(StringBuilder out, int indent)
Description copied from class:AbstractClassifier
Returns a string representation of the model.- Specified by:
getModelDescription
in classAbstractClassifier
- Parameters:
out
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
getModelMeasurementsImpl
protected Measurement[] getModelMeasurementsImpl()
Description copied from class:AbstractClassifier
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. Note that this will produce compiler errors if not overridden.- Specified by:
getModelMeasurementsImpl
in classAbstractClassifier
- Returns:
- an array of measurements to be used in evaluation tasks
-
calcByteSize
public int calcByteSize()
-
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
- Specified by:
getVotesForInstance
in classAbstractClassifier
- Parameters:
inst
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
normalizeTargetValue
public double normalizeTargetValue(double value)
-
getNormalizedError
public double getNormalizedError(Instance inst, double prediction)
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance inst)
Method for updating (training) the model using a new instance- Specified by:
trainOnInstanceImpl
in classAbstractClassifier
- Parameters:
inst
- the instance to be used for training
-
processInstance
public void processInstance(Instance inst, ARFFIMTDD.Node node, double prediction, double normalError, boolean growthAllowed, boolean inAlternate)
-
newNumericClassObserver
protected FIMTDDNumericAttributeClassObserver newNumericClassObserver()
-
newSplitNode
protected ARFFIMTDD.SplitNode newSplitNode(InstanceConditionalTest splitTest)
-
newLeafNode
protected ARFFIMTDD.LeafNode newLeafNode()
-
newLeafModel
protected ARFFIMTDD.FIMTDDPerceptron newLeafModel()
-
checkRoot
protected void checkRoot()
-
computeHoeffdingBound
public static double computeHoeffdingBound(double range, double confidence, double n)
-
attemptToSplit
protected void attemptToSplit(ARFFIMTDD.LeafNode node, ARFFIMTDD.Node parent, int parentIndex)
-
computeSD
public double computeSD(double squaredVal, double val, double size)
-
scalarProduct
public double scalarProduct(DoubleVector u, DoubleVector v)
-
-