Configurable
, java.io.Serializable
, CapabilitiesHandler
, Classifier
, MultiClassClassifier
, AWTRenderable
, Learner<Example<Instance>>
, MOAObject
, OptionHandler
ADACC
public class DACC extends AbstractClassifier implements MultiClassClassifier
Modifier and Type | Class | Description |
---|---|---|
protected class |
DACC.Pair |
This helper class is used to sort an array of pairs of integers: val and index.
|
Modifier and Type | Field | Description |
---|---|---|
MultiChoiceOption |
combinationOption |
Combination functions: MAX and WVD (MAX leads to a faster reactivity to the change, WVD is more robust to noise)
|
protected Classifier[] |
ensemble |
Ensemble of classifiers
|
protected double[] |
ensembleAges |
Age of classifiers (to compare with maturity age)
|
protected DACC.Pair[] |
ensembleWeights |
Weights of classifiers
|
protected int[][] |
ensembleWindows |
Evaluation windows (recent classification errors)
|
FloatOption |
evaluationSizeOption |
Size of the evaluation window for weights computing
|
ClassOption |
learnerOption |
Base classifier
|
FloatOption |
maturityOption |
Maturity age of classifiers
|
FloatOption |
memberCountOption |
Ensemble size
|
protected int |
nbInstances |
Number of instances from the stream
|
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
config
Constructor | Description |
---|---|
DACC() |
Modifier and Type | Method | Description |
---|---|---|
void |
discardModel(int index) |
Resets a classifier in the ensemble
|
protected DACC.Pair[] |
getHalf(boolean bestHalf) |
Returns the best (or worst) half of classifiers in the adaptive ensemble.
|
protected java.util.ArrayList<java.lang.Integer> |
getMAXIndexes() |
Returns the classifiers that vote for the final prediction
when the MAX combination function is selected
|
void |
getModelDescription(java.lang.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. |
protected int |
getNbActiveClassifiers() |
Returns the number of classifiers used for prediction
which includes the adaptive learners and the snapshots in ADACC
|
protected int |
getNbAdaptiveClassifiers() |
Returns the number of adaptive classifiers in the ensemble
which excludes the static snapshots in ADACC
|
java.lang.String |
getPurposeString() |
Dictionary with option texts and objects
|
Classifier[] |
getSubClassifiers() |
Gets the classifiers of this ensemble.
|
double[] |
getVotesForInstance(Instance inst) |
Predicts the class memberships for a given instance.
|
protected java.util.ArrayList<java.lang.Integer> |
getWVDIndexes() |
Returns the classifiers that vote for the final prediction
when the WVD combination function is selected
|
protected void |
initVariables() |
Initializes the method variables
|
boolean |
isRandomizable() |
Gets whether this learner needs a random seed.
|
void |
resetLearningImpl() |
Resets this classifier.
|
protected void |
trainAndClassify(Instance inst) |
Receives a training instance from the stream and
updates the adaptive classifiers accordingly
|
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. |
protected double |
updateEvaluationWindow(int index,
int val) |
Updates the evaluation window of a classifier and returns the
updated weight value.
|
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance, trainOnInstance
copy, measureByteSize, measureByteSize, toString
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
getCapabilities
measureByteSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCLICreationString, getOptions, prepareForUse, prepareForUse
public ClassOption learnerOption
public FloatOption memberCountOption
public FloatOption maturityOption
public FloatOption evaluationSizeOption
public MultiChoiceOption combinationOption
protected Classifier[] ensemble
protected DACC.Pair[] ensembleWeights
protected double[] ensembleAges
protected int[][] ensembleWindows
protected int nbInstances
public java.lang.String getPurposeString()
AbstractOptionHandler
getPurposeString
in interface OptionHandler
getPurposeString
in class AbstractClassifier
protected void initVariables()
public void resetLearningImpl()
AbstractClassifier
resetLearningImpl
in class AbstractClassifier
public void trainOnInstanceImpl(Instance inst)
AbstractClassifier
trainOnInstanceImpl
in class AbstractClassifier
inst
- the instance to be used for trainingpublic double[] getVotesForInstance(Instance inst)
Classifier
getVotesForInstance
in interface Classifier
getVotesForInstance
in class AbstractClassifier
inst
- the instance to be classifiedprotected void trainAndClassify(Instance inst)
inst
- the instance from the streampublic void discardModel(int index)
index
- the index of the classifier in the ensembleprotected double updateEvaluationWindow(int index, int val)
index
- the index of the classifier in the ensembleval
- the last evaluation record of the classifierprotected DACC.Pair[] getHalf(boolean bestHalf)
bestHalf
- boolean value set to true (false) if we want to return
the best (worst) half of adaptive classifiers.protected java.util.ArrayList<java.lang.Integer> getMAXIndexes()
protected java.util.ArrayList<java.lang.Integer> getWVDIndexes()
protected int getNbActiveClassifiers()
protected int getNbAdaptiveClassifiers()
public void getModelDescription(java.lang.StringBuilder out, int indent)
AbstractClassifier
getModelDescription
in class AbstractClassifier
out
- the stringbuilder to add the descriptionindent
- the number of characters to indentprotected Measurement[] getModelMeasurementsImpl()
AbstractClassifier
getModelMeasurementsImpl
in class AbstractClassifier
public boolean isRandomizable()
Learner
isRandomizable
in interface Learner<Example<Instance>>
public Classifier[] getSubClassifiers()
Classifier
getSubClassifiers
in interface Classifier
getSubClassifiers
in class AbstractClassifier
Copyright © 2020 University of Waikato, Hamilton, NZ. All Rights Reserved.