Package moa.classifiers.multilabel
Class MEKAClassifier
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.AbstractMultiLabelLearner
-
- moa.classifiers.multilabel.MEKAClassifier
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiLabelLearner
,MultiTargetRegressor
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class MEKAClassifier extends AbstractMultiLabelLearner implements MultiLabelLearner, MultiTargetRegressor, Serializable
Wrapper for MEKA classifiers.- Version:
- $Revision: 1 $
- Author:
- Jesse Read
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description WEKAClassOption
baseLearnerOption
protected weka.classifiers.Classifier
classifier
protected SamoaToWekaInstanceConverter
instanceConverter
protected weka.core.Instances
instancesBuffer
protected boolean
isClassificationEnabled
-
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 MEKAClassifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createWekaClassifier(String[] options)
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 samoaInstance)
String
getPurposeString()
Dictionary with option texts and objectsdouble[]
getVotesForInstance(Instance samoaInstance)
Predicts the class memberships for a given instance.boolean
isRandomizable()
Gets whether this learner needs a random seed.void
resetLearningImpl()
Resets this classifier.void
trainOnInstanceImpl(MultiLabelInstance samoaInstance)
-
Methods inherited from class moa.classifiers.AbstractMultiLabelLearner
getPredictionForInstance, getPredictionForInstance, trainOnInstanceImpl
-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getSubClassifiers, 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.gui.AWTRenderable
getAWTRenderer
-
Methods inherited from interface moa.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.classifiers.Classifier
copy, correctlyClassifies, getPredictionForInstance, getSubClassifiers, trainOnInstance
-
Methods inherited from interface moa.learners.Learner
getModel, getModelContext, getModelMeasurements, getPredictionForInstance, getSublearners, getVotesForInstance, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance
-
Methods inherited from interface moa.MOAObject
getDescription, measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
instanceConverter
protected SamoaToWekaInstanceConverter instanceConverter
-
baseLearnerOption
public WEKAClassOption baseLearnerOption
-
classifier
protected weka.classifiers.Classifier classifier
-
instancesBuffer
protected weka.core.Instances instancesBuffer
-
isClassificationEnabled
protected boolean isClassificationEnabled
-
-
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(MultiLabelInstance samoaInstance)
- Specified by:
trainOnInstanceImpl
in interfaceMultiLabelLearner
- Specified by:
trainOnInstanceImpl
in classAbstractMultiLabelLearner
-
getVotesForInstance
public double[] getVotesForInstance(Instance samoaInstance)
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
- Overrides:
getVotesForInstance
in classAbstractMultiLabelLearner
- Parameters:
samoaInstance
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
getPredictionForInstance
public Prediction getPredictionForInstance(MultiLabelInstance samoaInstance)
- Specified by:
getPredictionForInstance
in interfaceMultiLabelLearner
- Specified by:
getPredictionForInstance
in classAbstractMultiLabelLearner
-
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
-
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
-
-