public class OnlineAccuracyUpdatedEnsemble extends AbstractClassifier
Modifier and Type | Class and Description |
---|---|
protected class |
OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory |
Modifier and Type | Field and 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
classOptionNamesToPreparedObjects, options
Constructor and Description |
---|
OnlineAccuracyUpdatedEnsemble() |
Modifier and Type | Method and 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,
weka.core.Instance example)
Computes the weight of a learner before training a given example.
|
protected void |
createNewClassifier(weka.core.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(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(weka.core.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(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. |
contextIsCompatible, copy, correctlyClassifies, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModelContext, getModelMeasurements, getNominalValueString, getPurposeString, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, 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 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(weka.core.Instance inst)
AbstractClassifier
trainOnInstanceImpl
in class AbstractClassifier
inst
- the instance to be used for trainingpublic boolean isRandomizable()
public double[] getVotesForInstance(weka.core.Instance inst)
inst
- the instance to be classifiedpublic void getModelDescription(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(weka.core.Instance inst)
inst
- New exampleprotected void enforceMemoryLimit()
protected void computeMseR()
protected double computeWeight(int i, weka.core.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 © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.