public class AccuracyUpdatedEnsemble extends AbstractClassifier
| Modifier and Type | Field and Description |
|---|---|
protected Classifier |
candidate
Candidate classifier.
|
IntOption |
chunkSizeOption
Chunk size.
|
protected long[] |
classDistributions
Class distributions.
|
protected weka.core.Instances |
currentChunk
Current chunk of instances.
|
ClassOption |
learnerOption
Type of classifier to use as a component classifier.
|
protected Classifier[] |
learners
Ensemble classifiers.
|
IntOption |
maxByteSizeOption
Determines the maximum size of model (evaluated after every chunk).
|
IntOption |
memberCountOption
Number of component classifiers.
|
protected int |
processedInstances
Number of processed examples.
|
protected double[][] |
weights
The weights of stored classifiers.
|
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModelclassOptionNamesToPreparedObjects, options| Constructor and Description |
|---|
AccuracyUpdatedEnsemble() |
| Modifier and Type | Method and Description |
|---|---|
protected Classifier |
addToStored(Classifier newClassifier,
double newClassifiersWeight)
Adds a classifier to the storage.
|
protected double |
computeMse(Classifier learner,
weka.core.Instances chunk)
Computes the MSE of a learner for a given chunk of examples.
|
protected double |
computeMseR()
Computes the MSEr threshold.
|
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.
|
protected void |
processChunk()
Processes a chunk of instances.
|
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, trainOnInstancediscoverOptionsViaReflection, getCLICreationString, getOptions, getPreparedClassOption, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUsecopy, measureByteSize, measureByteSize, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCLICreationString, getOptions, prepareForUse, prepareForUsemeasureByteSizepublic ClassOption learnerOption
public IntOption memberCountOption
public IntOption chunkSizeOption
public IntOption maxByteSizeOption
protected double[][] weights
protected long[] classDistributions
protected Classifier[] learners
protected int processedInstances
protected Classifier candidate
protected weka.core.Instances currentChunk
public void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
AbstractOptionHandlerprepareForUseImpl
and not prepareForUse since
prepareForUse calls prepareForUseImpl.prepareForUseImpl in class AbstractClassifiermonitor - the TaskMonitor to userepository - the ObjectRepository to usepublic void resetLearningImpl()
AbstractClassifierresetLearningImpl in class AbstractClassifierpublic void trainOnInstanceImpl(weka.core.Instance inst)
AbstractClassifiertrainOnInstanceImpl in class AbstractClassifierinst - 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)
AbstractClassifiergetModelDescription in class AbstractClassifierout - the stringbuilder to add the descriptionindent - the number of characters to indentpublic Classifier[] getSubClassifiers()
ClassifiergetSubClassifiers in interface ClassifiergetSubClassifiers in class AbstractClassifierprotected void processChunk()
protected void enforceMemoryLimit()
protected double computeMseR()
protected double computeMse(Classifier learner, weka.core.Instances chunk)
learner - classifier to compute errorchunk - chunk of examplesprotected Measurement[] getModelMeasurementsImpl()
getModelMeasurementsImpl in class AbstractClassifierprotected Classifier addToStored(Classifier newClassifier, double newClassifiersWeight)
newClassifier - The classifier to add.newClassifiersWeight - The new classifiers weight.Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.