Package moa.classifiers.meta
Class LimAttClassifier
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.meta.LimAttClassifier
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class LimAttClassifier extends AbstractClassifier implements MultiClassClassifier
Ensemble Combining Restricted Hoeffding Trees using Stacking. It produces a classification model based on an ensemble of restricted decision trees, where each tree is built from a distinct subset of the attributes. The overall model is formed by combining the log-odds of the predicted class probabilities of these trees using sigmoid perceptrons, with one perceptron per class. In contrast to the standard boosting approach, which forms an ensemble classifier in a greedy fashion, building each tree in sequence and assigning corresponding weights as a by-product, our method generates each tree in parallel and combines them using perceptron classifiers by adopting the stacking approach. For more information see,
Albert Bifet, Eibe Frank, Geoffrey Holmes, Bernhard Pfahringer: Accurate Ensembles for Data Streams: Combining Restricted Hoeffding Trees using Stacking. Journal of Machine Learning Research - Proceedings Track 13: 225-240 (2010) BibTeX:@article{BifetFHP10, author = {Albert Bifet and Eibe Frank and Geoffrey Holmes and Bernhard Pfahringer}, title = {Accurate Ensembles for Data Streams: Combining Restricted Hoeffding Trees using Stacking}, journal = {Journal of Machine Learning Research - Proceedings Track}, volume = {13}, year = {2010}, pages = {225-240} }
- Version:
- $Revision: 7 $
- Author:
- Albert Bifet (abifet at cs dot waikato dot ac dot nz), Eibe Frank (eibe{[at]}cs{[dot]}waikato{[dot]}ac{[dot]}nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LimAttClassifier.CombinationGenerator
-
Field Summary
Fields Modifier and Type Field Description protected ADWIN[]
ADError
FlagOption
adwinReplaceWorstClassifierOption
ClassOption
baseLearnerOption
FlagOption
bigTreesOption
FloatOption
deltaAdwinOption
protected Classifier[]
ensemble
protected boolean
initClassifiers
IntOption
initialNumInstancesOption
protected boolean
initMatrixCodes
FloatOption
learningRatioOption
protected int[][]
matrixCodes
IntOption
numAttributesOption
protected int
numberAttributes
protected int
numberOfChangesDetected
IntOption
numEnsemblePruningOption
protected int
numInstances
FloatOption
oddsOffsetOption
FloatOption
penaltyFactorOption
FlagOption
pruneOption
protected boolean
reset
protected double[][]
weightAttribute
FloatOption
weightShrinkOption
-
Fields inherited from class moa.classifiers.AbstractClassifier
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description LimAttClassifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
getPurposeString()
Dictionary with option texts and objectsClassifier[]
getSubClassifiers()
Gets the classifiers of this ensemble.double[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.double[]
getVotesForInstancePerceptron(double[][] votesEnsemble, int[] bestClassifiers, int numClasses)
boolean
isRandomizable()
Gets whether this learner needs a random seed.double
prediction(double[][] votes, int classVal)
double
predictionPruning(double[][] votes, int[] bestClassifiers, int classVal)
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.void
trainOnInstanceImplPerceptron(int numClasses, int actualClass, double[][] votes)
-
Methods inherited from class moa.classifiers.AbstractClassifier
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
-
Methods inherited from class moa.options.AbstractOptionHandler
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
baseLearnerOption
public ClassOption baseLearnerOption
-
numAttributesOption
public IntOption numAttributesOption
-
weightShrinkOption
public FloatOption weightShrinkOption
-
deltaAdwinOption
public FloatOption deltaAdwinOption
-
oddsOffsetOption
public FloatOption oddsOffsetOption
-
pruneOption
public FlagOption pruneOption
-
bigTreesOption
public FlagOption bigTreesOption
-
numEnsemblePruningOption
public IntOption numEnsemblePruningOption
-
adwinReplaceWorstClassifierOption
public FlagOption adwinReplaceWorstClassifierOption
-
ensemble
protected Classifier[] ensemble
-
ADError
protected ADWIN[] ADError
-
numberOfChangesDetected
protected int numberOfChangesDetected
-
matrixCodes
protected int[][] matrixCodes
-
initMatrixCodes
protected boolean initMatrixCodes
-
initClassifiers
protected boolean initClassifiers
-
numberAttributes
protected int numberAttributes
-
numInstances
protected int numInstances
-
learningRatioOption
public FloatOption learningRatioOption
-
penaltyFactorOption
public FloatOption penaltyFactorOption
-
initialNumInstancesOption
public IntOption initialNumInstancesOption
-
weightAttribute
protected double[][] weightAttribute
-
reset
protected boolean reset
-
-
Method Detail
-
getPurposeString
public String getPurposeString()
Description copied from class:AbstractOptionHandler
Dictionary with option texts and objects- Specified by:
getPurposeString
in interfaceOptionHandler
- Overrides:
getPurposeString
in classAbstractClassifier
- Returns:
- the string with the purpose of this object
-
resetLearningImpl
public void resetLearningImpl()
Description copied from class:AbstractClassifier
Resets this classifier. It must be similar to starting a new classifier from scratch.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.- Specified by:
resetLearningImpl
in classAbstractClassifier
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance inst)
Description copied from class:AbstractClassifier
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. Note that this will produce compiler errors if not overridden.- Specified by:
trainOnInstanceImpl
in classAbstractClassifier
- Parameters:
inst
- the instance to be used for training
-
getVotesForInstance
public double[] getVotesForInstance(Instance inst)
Description copied from interface:Classifier
Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero.- Specified by:
getVotesForInstance
in interfaceClassifier
- Specified by:
getVotesForInstance
in classAbstractClassifier
- Parameters:
inst
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
isRandomizable
public boolean isRandomizable()
Description copied from interface:Learner
Gets whether this learner needs a random seed. Examples of methods that needs a random seed are bagging and boosting.- Specified by:
isRandomizable
in interfaceLearner<Example<Instance>>
- Returns:
- true if the learner needs a random seed.
-
getModelDescription
public void getModelDescription(StringBuilder out, int indent)
Description copied from class:AbstractClassifier
Returns a string representation of the model.- Specified by:
getModelDescription
in classAbstractClassifier
- Parameters:
out
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
getModelMeasurementsImpl
protected Measurement[] getModelMeasurementsImpl()
Description copied from class:AbstractClassifier
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. Note that this will produce compiler errors if not overridden.- Specified by:
getModelMeasurementsImpl
in classAbstractClassifier
- Returns:
- an array of measurements to be used in evaluation tasks
-
getSubClassifiers
public Classifier[] getSubClassifiers()
Description copied from interface:Classifier
Gets the classifiers of this ensemble. Returns null if this learner is a single learner.- Specified by:
getSubClassifiers
in interfaceClassifier
- Overrides:
getSubClassifiers
in classAbstractClassifier
- Returns:
- an array of the learners of the ensemble
-
trainOnInstanceImplPerceptron
public void trainOnInstanceImplPerceptron(int numClasses, int actualClass, double[][] votes)
-
predictionPruning
public double predictionPruning(double[][] votes, int[] bestClassifiers, int classVal)
-
prediction
public double prediction(double[][] votes, int classVal)
-
getVotesForInstancePerceptron
public double[] getVotesForInstancePerceptron(double[][] votesEnsemble, int[] bestClassifiers, int numClasses)
-
-