Configurable
, java.io.Serializable
, CapabilitiesHandler
, Classifier
, MultiClassClassifier
, AWTRenderable
, Learner<Example<Instance>>
, MOAObject
, OptionHandler
public class OnlineAccuracyUpdatedEnsemble extends AbstractClassifier implements MultiClassClassifier
Modifier and Type | Class | Description |
---|---|---|
protected class |
OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory |
Modifier and Type | Field | Description |
---|---|---|
protected OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory |
candidate |
Candidate classifier.
|
protected long[] |
classDistributions |
Class distributions.
|
protected int[] |
currentWindow |
Current window of instance class values.
|
protected OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory[] |
ensemble |
Ensemble classifiers.
|
ClassOption |
learnerOption |
Type of classifier to use as a component classifier.
|
FlagOption |
linearOption |
Determines whether additional information should be sent to the output.
|
IntOption |
maxByteSizeOption |
Determines the maximum size of model (evaluated after every chunk).
|
IntOption |
memberCountOption |
Number of component classifiers.
|
protected double |
mse_r |
The mean square residual in a given moment, based on a window of latest examples.
|
protected int |
processedInstances |
Number of processed examples.
|
FlagOption |
verboseOption |
Determines whether additional information should be sent to the output.
|
protected double[][] |
weights |
The weights of stored classifiers.
|
protected int |
windowSize |
Window size.
|
FloatOption |
windowSizeOption |
Chunk size.
|
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
config
Constructor | Description |
---|---|
OnlineAccuracyUpdatedEnsemble() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
addToStored(OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory newClassifier,
double newClassifiersWeight) |
Adds a classifier to the storage.
|
protected void |
computeMseR() |
Computes the MSEr threshold.
|
protected double |
computeWeight(int i,
Instance example) |
Computes the weight of a learner before training a given example.
|
protected void |
createNewClassifier(Instance inst) |
Processes a chunk.
|
protected void |
enforceMemoryLimit() |
Checks if the memory limit is exceeded and if so prunes the classifiers in the ensemble.
|
void |
getModelDescription(java.lang.StringBuilder out,
int indent) |
Returns a string representation of the model.
|
protected Measurement[] |
getModelMeasurementsImpl() |
Adds ensemble weights to the measurements.
|
Classifier[] |
getSubClassifiers() |
Gets the classifiers of this ensemble.
|
double[] |
getVotesForInstance(Instance inst) |
Predicts a class for an example.
|
boolean |
isRandomizable() |
Determines whether the classifier is randomizable.
|
void |
prepareForUseImpl(TaskMonitor monitor,
ObjectRepository repository) |
This method describes the implementation of how to prepare this object for use.
|
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. |
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getPurposeString, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, 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 IntOption memberCountOption
public FloatOption windowSizeOption
public IntOption maxByteSizeOption
public FlagOption verboseOption
public FlagOption linearOption
protected double[][] weights
protected long[] classDistributions
protected OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory[] ensemble
protected int processedInstances
protected OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory candidate
protected int[] currentWindow
protected double mse_r
protected int windowSize
public void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
AbstractOptionHandler
prepareForUseImpl
and not prepareForUse
since
prepareForUse
calls prepareForUseImpl
.prepareForUseImpl
in class AbstractClassifier
monitor
- the TaskMonitor to userepository
- the ObjectRepository to usepublic 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 boolean isRandomizable()
isRandomizable
in interface Learner<Example<Instance>>
public double[] getVotesForInstance(Instance inst)
getVotesForInstance
in interface Classifier
getVotesForInstance
in class AbstractClassifier
inst
- the instance to be classifiedpublic 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 indentpublic Classifier[] getSubClassifiers()
Classifier
getSubClassifiers
in interface Classifier
getSubClassifiers
in class AbstractClassifier
protected void createNewClassifier(Instance inst)
inst
- New exampleprotected void enforceMemoryLimit()
protected void computeMseR()
protected double computeWeight(int i, Instance example)
i
- the identifier (in terms of array learners)
of the classifier for which the weight is supposed to be computedexample
- the newest exampleprotected Measurement[] getModelMeasurementsImpl()
getModelMeasurementsImpl
in class AbstractClassifier
protected void addToStored(OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory newClassifier, double newClassifiersWeight)
newClassifier
- The classifier to add.newClassifiersWeight
- The new classifiers weight.Copyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.