Package moa.classifiers.meta
Class MLCviaMTR
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.AbstractMultiLabelLearner
-
- moa.classifiers.meta.MLCviaMTR
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiLabelClassifier
,MultiLabelLearner
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class MLCviaMTR extends AbstractMultiLabelLearner implements MultiLabelClassifier
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected InstancesHeader
header
protected MultiTargetRegressor
learner
ClassOption
regressorOption
-
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 MLCviaMTR()
-
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.Prediction
getPredictionForInstance(MultiLabelInstance inst)
boolean
isRandomizable()
Gets whether this learner needs a random seed.void
resetLearningImpl()
Resets this classifier.void
setModelContext(InstancesHeader ih)
Sets the reference to the header of the data stream.void
setRandomSeed(int i)
Sets the seed for random number generation.void
trainOnInstanceImpl(MultiLabelInstance instance)
-
Methods inherited from class moa.classifiers.AbstractMultiLabelLearner
getPredictionForInstance, getPredictionForInstance, getVotesForInstance, trainOnInstanceImpl
-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPurposeString, getSubClassifiers, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, 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, getPredictionForInstance, getSubClassifiers, getVotesForInstance, trainOnInstance
-
Methods inherited from interface moa.learners.Learner
getModel, getModelContext, getModelMeasurements, getPredictionForInstance, getSublearners, getVotesForInstance, resetLearning, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance
-
Methods inherited from interface moa.MOAObject
getDescription, measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
header
protected InstancesHeader header
-
learner
protected MultiTargetRegressor learner
-
regressorOption
public ClassOption regressorOption
-
-
Method Detail
-
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.
-
trainOnInstanceImpl
public void trainOnInstanceImpl(MultiLabelInstance instance)
- Specified by:
trainOnInstanceImpl
in interfaceMultiLabelLearner
- Specified by:
trainOnInstanceImpl
in classAbstractMultiLabelLearner
-
getPredictionForInstance
public Prediction getPredictionForInstance(MultiLabelInstance inst)
- Specified by:
getPredictionForInstance
in interfaceMultiLabelLearner
- Specified by:
getPredictionForInstance
in classAbstractMultiLabelLearner
-
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
-
setModelContext
public void setModelContext(InstancesHeader ih)
Description copied from interface:Learner
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- Specified by:
setModelContext
in interfaceLearner<Example<Instance>>
- Overrides:
setModelContext
in classAbstractClassifier
- Parameters:
ih
- the reference to the data stream header
-
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
-
setRandomSeed
public void setRandomSeed(int i)
Description copied from interface:Learner
Sets the seed for random number generation.- Specified by:
setRandomSeed
in interfaceLearner<Example<Instance>>
- Overrides:
setRandomSeed
in classAbstractClassifier
- Parameters:
i
- the 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
-
-