Package moa.classifiers.trees.iadem
Class Iadem2
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.trees.iadem.Iadem2
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
- Direct Known Subclasses:
Iadem3
public class Iadem2 extends AbstractClassifier implements MultiClassClassifier
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Iadem2.LeafNode
class
Iadem2.LeafNodeNB
class
Iadem2.LeafNodeNBKirkby
class
Iadem2.LeafNodeWeightedVote
class
Iadem2.Node
class
Iadem2.NominalVirtualNode
class
Iadem2.NumericVirtualNode
class
Iadem2.SplitNode
class
Iadem2.VirtualNode
-
Field Summary
Fields Modifier and Type Field Description FloatOption
attributeDiferentiation
ClassOption
driftDetectionMethodOption
static double
ERROR_MARGIN
protected AbstractChangeDetector
estimator
IntOption
gracePeriodOption
MultiChoiceOption
leafPredictionOption
int
naiveBayesLimit
protected int
numberOfInstancesProcessed
int
numberOfLeaves
int
numberOfNodes
ClassOption
numericEstimatorOption
double
percentInCommon
FloatOption
splitConfidenceOption
MultiChoiceOption
splitCriterionOption
MultiChoiceOption
splitTestsOption
protected Iadem2.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 Iadem2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createRoot(Instance instance)
double
getAttributeDifferentiation()
double[]
getClassVotes(Instance instance)
int
getMaxNumberOfBins()
IademSplitCriterion
getMeasure()
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.int
getNaiveBayesLimit()
long
getNumberOfInstancesProcessed()
int
getNumberOfLeaves()
int
getNumberOfNodes()
void
getNumberOfNodes(int[] count)
IademNumericAttributeObserver
getNumericAttObserver()
double
getPercentInCommon()
Iadem2.Node
getTreeRoot()
int
getValuesOfNominalAttributes(int attIndex, Instance instance)
double[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.void
incrNumberOfInstancesProcessed()
boolean
isOnlyBinaryTest()
boolean
isOnlyMultiwayTest()
boolean
isRandomizable()
Gets whether this learner needs a random seed.void
learnFromInstance(Instance instance)
AbstractChangeDetector
newEstimator()
Iadem2.LeafNode
newLeafNode(Iadem2.Node parent, long instTreeCountSinceVirtual, long instNodeCountSinceVirtual, double[] classDist, Instance instance)
protected IademNumericAttributeObserver
newNumericClassObserver()
void
newSplit(int numOfLeaves)
void
resetLearningImpl()
Resets this classifier.void
setNumberOfLeaves(int numberOfLeaves)
void
setNumberOfNodes(int numberOfNodes)
void
setTreeRoot(Iadem2.Node newRoot)
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.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getPurposeString, 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
-
numericEstimatorOption
public ClassOption numericEstimatorOption
-
gracePeriodOption
public IntOption gracePeriodOption
-
splitCriterionOption
public MultiChoiceOption splitCriterionOption
-
splitConfidenceOption
public FloatOption splitConfidenceOption
-
splitTestsOption
public MultiChoiceOption splitTestsOption
-
leafPredictionOption
public MultiChoiceOption leafPredictionOption
-
driftDetectionMethodOption
public ClassOption driftDetectionMethodOption
-
attributeDiferentiation
public FloatOption attributeDiferentiation
-
naiveBayesLimit
public final int naiveBayesLimit
- See Also:
- Constant Field Values
-
percentInCommon
public final double percentInCommon
- See Also:
- Constant Field Values
-
numberOfInstancesProcessed
protected int numberOfInstancesProcessed
-
ERROR_MARGIN
public static final double ERROR_MARGIN
- See Also:
- Constant Field Values
-
treeRoot
protected Iadem2.Node treeRoot
-
estimator
protected AbstractChangeDetector estimator
-
numberOfNodes
public int numberOfNodes
-
numberOfLeaves
public int numberOfLeaves
-
-
Method Detail
-
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.
-
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
-
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.- Specified by:
trainOnInstanceImpl
in classAbstractClassifier
- Parameters:
inst
- the instance to be used for training
-
newNumericClassObserver
protected IademNumericAttributeObserver newNumericClassObserver()
-
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
-
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
-
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
-
newEstimator
public AbstractChangeDetector newEstimator()
-
createRoot
public void createRoot(Instance instance)
-
getMaxNumberOfBins
public int getMaxNumberOfBins()
-
getNumericAttObserver
public IademNumericAttributeObserver getNumericAttObserver()
-
getNumberOfInstancesProcessed
public long getNumberOfInstancesProcessed()
-
newLeafNode
public Iadem2.LeafNode newLeafNode(Iadem2.Node parent, long instTreeCountSinceVirtual, long instNodeCountSinceVirtual, double[] classDist, Instance instance)
-
getAttributeDifferentiation
public double getAttributeDifferentiation()
-
getMeasure
public IademSplitCriterion getMeasure() throws IademException
- Throws:
IademException
-
setTreeRoot
public void setTreeRoot(Iadem2.Node newRoot)
-
learnFromInstance
public void learnFromInstance(Instance instance) throws IademException
- Throws:
IademException
-
getTreeRoot
public Iadem2.Node getTreeRoot()
-
getClassVotes
public double[] getClassVotes(Instance instance)
-
getPercentInCommon
public double getPercentInCommon()
-
getValuesOfNominalAttributes
public int getValuesOfNominalAttributes(int attIndex, Instance instance)
-
getNaiveBayesLimit
public int getNaiveBayesLimit()
-
isOnlyMultiwayTest
public boolean isOnlyMultiwayTest()
-
isOnlyBinaryTest
public boolean isOnlyBinaryTest()
-
incrNumberOfInstancesProcessed
public void incrNumberOfInstancesProcessed()
-
getNumberOfNodes
public void getNumberOfNodes(int[] count)
-
newSplit
public void newSplit(int numOfLeaves)
-
getNumberOfNodes
public int getNumberOfNodes()
-
setNumberOfNodes
public void setNumberOfNodes(int numberOfNodes)
-
getNumberOfLeaves
public int getNumberOfLeaves()
-
setNumberOfLeaves
public void setNumberOfLeaves(int numberOfLeaves)
-
-