public class DACC extends AbstractClassifier
Modifier and Type | Class and 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 and 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
classOptionNamesToPreparedObjects, options
Constructor and Description |
---|
DACC() |
Modifier and Type | Method and 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 ArrayList<Integer> |
getMAXIndexes()
Returns the classifiers that vote for the final prediction
when the MAX combination function is selected
|
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. |
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
|
String |
getPurposeString()
Gets the purpose of this object
|
Classifier[] |
getSubClassifiers()
Gets the classifiers of this ensemble.
|
double[] |
getVotesForInstance(weka.core.Instance inst)
Predicts the class memberships for a given instance.
|
protected ArrayList<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 classifier needs a random seed.
|
void |
resetLearningImpl()
Resets this classifier.
|
protected void |
trainAndClassify(weka.core.Instance inst)
Receives a training instance from the stream and
updates the adaptive classifiers accordingly
|
void |
trainOnInstanceImpl(weka.core.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, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModelContext, getModelMeasurements, getNominalValueString, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance
discoverOptionsViaReflection, getCLICreationString, getOptions, getPreparedClassOption, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCLICreationString, getOptions, prepareForUse, prepareForUse
measureByteSize
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 String getPurposeString()
OptionHandler
getPurposeString
in interface OptionHandler
getPurposeString
in class AbstractClassifier
protected void initVariables()
public void resetLearningImpl()
AbstractClassifier
resetLearningImpl
in class AbstractClassifier
public void trainOnInstanceImpl(weka.core.Instance inst)
AbstractClassifier
trainOnInstanceImpl
in class AbstractClassifier
inst
- the instance to be used for trainingpublic double[] getVotesForInstance(weka.core.Instance inst)
Classifier
inst
- the instance to be classifiedprotected void trainAndClassify(weka.core.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.horizon
- protected ArrayList<Integer> getMAXIndexes()
protected ArrayList<Integer> getWVDIndexes()
protected int getNbActiveClassifiers()
protected int getNbAdaptiveClassifiers()
public void getModelDescription(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()
Classifier
public Classifier[] getSubClassifiers()
Classifier
getSubClassifiers
in interface Classifier
getSubClassifiers
in class AbstractClassifier
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.