Package moa.learners
Interface Learner<E extends Example>
-
- All Superinterfaces:
AWTRenderable
,Configurable
,MOAObject
,OptionHandler
,Serializable
- All Known Subinterfaces:
ALClassifier
,AMRulesLearner
,AMRulesRegressorFunction
,Classifier
,FeatureImportanceClassifier
,LearnerSemiSupervised<E>
,MultiLabelClassifier
,MultiLabelLearner
,MultiTargetLearnerSemiSupervised
,MultiTargetRegressor
- All Known Implementing Classes:
AbstractAMRules
,AbstractAMRulesFunctionBasicMlLearner
,AbstractClassifier
,AbstractMultiLabelLearner
,AccuracyUpdatedEnsemble
,AccuracyWeightedEnsemble
,ADACC
,AdaGrad
,AdaHoeffdingOptionTree
,AdaptiveMultiTargetRegressor
,AdaptiveNodePredictor
,AdaptiveRandomForest
,AdaptiveRandomForestRegressor
,ADOB
,ALRandom
,ALUncertainty
,AMRulesMultiLabelClassifier
,AMRulesMultiLabelLearner
,AMRulesMultiLabelLearnerSemiSuper
,AMRulesMultiTargetRegressor
,AMRulesMultiTargetRegressorSemiSuper
,AMRulesRegressor
,AMRulesRegressorOld
,ARFFIMTDD
,ARFHoeffdingTree
,ASHoeffdingTree
,Autoencoder
,BasicMultiLabelClassifier
,BasicMultiLabelLearner
,BasicMultiTargetRegressor
,BinaryClassifierFromRegressor
,BOLE
,CAND
,ChangeDetectorLearner
,ClassifierWithFeatureImportance
,CSMOTE
,DACC
,DecisionStump
,DominantLabelsClassifier
,DriftDetectionMethodClassifier
,DynamicWeightedMajority
,EFDT
,FadingTargetMean
,FeatureImportanceHoeffdingTree
,FeatureImportanceHoeffdingTreeEnsemble
,FIMTDD
,HeterogeneousEnsembleAbstract
,HeterogeneousEnsembleBlast
,HeterogeneousEnsembleBlastFadingFactors
,HoeffdingAdaptiveTree
,HoeffdingAdaptiveTreeClassifLeaves
,HoeffdingOptionTree
,HoeffdingTree
,HoeffdingTreeClassifLeaves
,HSTrees
,Iadem2
,Iadem3
,Iadem3Subtree
,ISOUPTree
,ISOUPTreeRF
,kNN
,kNNwithPAW
,kNNwithPAWandADWIN
,LearnNSE
,LeveragingBag
,LimAttClassifier
,LimAttHoeffdingTree
,LowPassFilteredLearner
,MajorityClass
,MajorityLabelset
,MEKAClassifier
,MLCviaMTR
,MLP
,MultilabelHoeffdingTree
,MultiLabelNaiveBayes
,MultiLabelPerceptronClassification
,MultiLabelRandomAMRules
,MultiTargetMeanRegressor
,MultiTargetNoChange
,MultiTargetPerceptronRegressor
,NaiveBayes
,NaiveBayesMultinomial
,NearestNeighbourDescription
,NoChange
,OCBoost
,OnlineAccuracyUpdatedEnsemble
,OnlineAdaBoost
,OnlineAdaC2
,OnlineCSB2
,OnlineRUSBoost
,OnlineSmoothBoost
,OnlineSMOTEBagging
,OnlineUnderOverBagging
,ORTO
,OzaBag
,OzaBagAdwin
,OzaBagAdwinML
,OzaBagASHT
,OzaBagML
,OzaBoost
,OzaBoostAdwin
,PairedLearners
,Perceptron
,Perceptron
,RandomAMRules
,RandomAMRulesOld
,RandomHoeffdingTree
,RandomRules
,RCD
,RebalanceStream
,RuleClassifier
,RuleClassifierNBayes
,SAMkNN
,SelfOptimisingBaseTree
,SelfOptimisingKNearestLeaves
,SGD
,SGDMultiClass
,SingleClassifierDrift
,SPegasos
,StackedPredictor
,StreamingGradientBoostedTrees
,StreamingRandomPatches
,TargetMean
,TemporallyAugmentedClassifier
,WeightedMajorityAlgorithm
,WEKAClassifier
public interface Learner<E extends Example> extends MOAObject, OptionHandler, AWTRenderable
Learner interface for incremental learning models.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MOAObject
getModel()
Gets the model if this learner.InstancesHeader
getModelContext()
Gets the reference to the header of the data stream.Measurement[]
getModelMeasurements()
Gets the current measurements of this learner.Prediction
getPredictionForInstance(E testInst)
Learner[]
getSublearners()
Gets the learners of this ensemble.double[]
getVotesForInstance(E example)
Predicts the class memberships for a given instance.boolean
isRandomizable()
Gets whether this learner needs a random seed.void
resetLearning()
Resets this learner.void
setModelContext(InstancesHeader ih)
Sets the reference to the header of the data stream.void
setRandomSeed(int s)
Sets the seed for random number generation.boolean
trainingHasStarted()
Gets whether training has started.double
trainingWeightSeenByModel()
Gets the sum of the weights of the instances that have been used by this learner during the training intrainOnInstance
void
trainOnInstance(E example)
Trains this learner incrementally using the given example.-
Methods inherited from interface moa.gui.AWTRenderable
getAWTRenderer
-
Methods inherited from interface moa.MOAObject
getDescription, measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
copy, getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
-
-
-
-
Method Detail
-
isRandomizable
boolean isRandomizable()
Gets whether this learner needs a random seed. Examples of methods that needs a random seed are bagging and boosting.- Returns:
- true if the learner needs a random seed.
-
setRandomSeed
void setRandomSeed(int s)
Sets the seed for random number generation.- Parameters:
s
- the seed
-
trainingHasStarted
boolean trainingHasStarted()
Gets whether training has started.- Returns:
- true if training has started
-
trainingWeightSeenByModel
double trainingWeightSeenByModel()
Gets the sum of the weights of the instances that have been used by this learner during the training intrainOnInstance
- Returns:
- the weight of the instances that have been used training
-
resetLearning
void resetLearning()
Resets this learner. It must be similar to starting a new learner from scratch.
-
trainOnInstance
void trainOnInstance(E example)
Trains this learner incrementally using the given example.- Parameters:
example
- the instance to be used for training
-
getVotesForInstance
double[] getVotesForInstance(E example)
Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero.- Parameters:
example
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
getModelMeasurements
Measurement[] getModelMeasurements()
Gets the current measurements of this learner.- Returns:
- an array of measurements to be used in evaluation tasks
-
getSublearners
Learner[] getSublearners()
Gets the learners of this ensemble. Returns null if this learner is a single learner.- Returns:
- an array of the learners of the ensemble
-
getModel
MOAObject getModel()
Gets the model if this learner.- Returns:
- the copy of this learner
-
setModelContext
void setModelContext(InstancesHeader ih)
Sets the reference to the header of the data stream. The header of the data stream is extended from WEKAInstances
. This header is needed to know the number of classes and attributes- Parameters:
ih
- the reference to the data stream header
-
getModelContext
InstancesHeader getModelContext()
Gets the reference to the header of the data stream. The header of the data stream is extended from WEKAInstances
. This header is needed to know the number of classes and attributes- Returns:
- the reference to the data stream header
-
getPredictionForInstance
Prediction getPredictionForInstance(E testInst)
-
-