Package moa.classifiers
Class AbstractMultiLabelLearner
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.AbstractMultiLabelLearner
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiLabelLearner
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
- Direct Known Subclasses:
AdaptiveMultiTargetRegressor
,AMRulesMultiLabelLearner
,AMRulesMultiLabelLearnerSemiSuper
,BasicMultiLabelLearner
,BasicMultiTargetRegressor
,DominantLabelsClassifier
,ISOUPTree
,MajorityLabelset
,MEKAClassifier
,MLCviaMTR
,MultiLabelRandomAMRules
,MultiTargetNoChange
,StackedPredictor
public abstract class AbstractMultiLabelLearner extends AbstractClassifier implements MultiLabelLearner
- See Also:
- Serialized Form
-
-
Field Summary
-
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 AbstractMultiLabelLearner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Prediction
getPredictionForInstance(Instance inst)
Gets the reference to the header of the data stream.abstract Prediction
getPredictionForInstance(MultiLabelInstance inst)
Prediction
getPredictionForInstance(Example<Instance> example)
double[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.void
trainOnInstanceImpl(Instance instance)
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.abstract void
trainOnInstanceImpl(MultiLabelInstance instance)
-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelDescription, getModelMeasurements, getModelMeasurementsImpl, getNominalValueString, getPurposeString, getSubClassifiers, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, resetLearningImpl, 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.gui.AWTRenderable
getAWTRenderer
-
Methods inherited from interface moa.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.classifiers.Classifier
copy, correctlyClassifies, getSubClassifiers, trainOnInstance
-
Methods inherited from interface moa.learners.Learner
getModel, getModelContext, getModelMeasurements, getSublearners, getVotesForInstance, isRandomizable, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance
-
Methods inherited from interface moa.MOAObject
getDescription, measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
-
-
-
-
Method Detail
-
trainOnInstanceImpl
public abstract void trainOnInstanceImpl(MultiLabelInstance instance)
- Specified by:
trainOnInstanceImpl
in interfaceMultiLabelLearner
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance instance)
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:
instance
- the instance to be used for training
-
getPredictionForInstance
public Prediction getPredictionForInstance(Example<Instance> example)
- Specified by:
getPredictionForInstance
in interfaceLearner<Example<Instance>>
- Overrides:
getPredictionForInstance
in classAbstractClassifier
-
getPredictionForInstance
public Prediction getPredictionForInstance(Instance inst)
Description copied from interface:Classifier
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- Specified by:
getPredictionForInstance
in interfaceClassifier
- Overrides:
getPredictionForInstance
in classAbstractClassifier
- Returns:
- the reference to the data stream header
-
getPredictionForInstance
public abstract Prediction getPredictionForInstance(MultiLabelInstance inst)
- Specified by:
getPredictionForInstance
in interfaceMultiLabelLearner
-
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
-
-