Package moa.classifiers.meta
Class RCD
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class RCD extends SingleClassifierDrift
Creates a set of classifiers, each one representing a different context. Reuses classifier associating to each one a sample of data and compares new data to old ones using a multivariate non-parametric statistical test. Tests are performed in parallel and classifiers are stored based on their accuracy and stored time. 1) Parameterized number of classifiers to store. 2) Classifiers are stored removing the older ones if the set is full. 3) Classifier with higher significance value is selected. Based on: Gonçalves Jr, Paulo Mauricio, and Roberto Souto Maior De Barros. "RCD: A recurring concept drift framework." Pattern Recognition Letters 34.9 (2013): 1018-1025.- Author:
- Paulo Goncalves (paulogoncalves at recife dot ifpe dot edu dot br)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
bufferSize
IntOption
bufferSizeOption
IntOption
classifiersSizeOption
protected List<Instance>
currentChunk
protected List<Instance>
currentChunk2
protected int
index
protected int
previousState
IntOption
quantityClassifiersTestOption
FloatOption
similarityBetweenDistributionsOption
ClassOption
statisticalTestOption
protected List<Instance>
testChunk
IntOption
testFrequencyOption
IntOption
threadSizeOption
-
Fields inherited from class moa.classifiers.drift.DriftDetectionMethodClassifier
baseLearnerOption, changeDetected, classifier, DDM_INCONTROL_LEVEL, DDM_OUTCONTROL_LEVEL, DDM_WARNING_LEVEL, ddmLevel, driftDetectionMethod, driftDetectionMethodOption, newclassifier, newClassifierReset, warningDetected
-
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 RCD()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.void
resetLearningImpl()
Resets this classifier.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.drift.DriftDetectionMethodClassifier
defineImmutableCapabilities, getModelDescription, getModelMeasurementsImpl, getPurposeString, isChangeDetected, isRandomizable, isWarningDetected
-
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, 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
-
statisticalTestOption
public ClassOption statisticalTestOption
-
similarityBetweenDistributionsOption
public FloatOption similarityBetweenDistributionsOption
-
bufferSizeOption
public IntOption bufferSizeOption
-
testFrequencyOption
public IntOption testFrequencyOption
-
classifiersSizeOption
public IntOption classifiersSizeOption
-
threadSizeOption
public IntOption threadSizeOption
-
quantityClassifiersTestOption
public IntOption quantityClassifiersTestOption
-
bufferSize
protected int bufferSize
-
previousState
protected int previousState
-
index
protected int index
-
-
Method Detail
-
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 classDriftDetectionMethodClassifier
-
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 classDriftDetectionMethodClassifier
- Parameters:
inst
- the instance to be used for training
-
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 classDriftDetectionMethodClassifier
- Parameters:
inst
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
-