Package moa.classifiers.rules.multilabel
Class AMRulesMultiLabelLearnerSemiSuper
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.AbstractMultiLabelLearner
-
- moa.classifiers.rules.multilabel.AMRulesMultiLabelLearnerSemiSuper
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiLabelLearner
,MultiTargetLearnerSemiSupervised
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
- Direct Known Subclasses:
AMRulesMultiTargetRegressorSemiSuper
public abstract class AMRulesMultiLabelLearnerSemiSuper extends AbstractMultiLabelLearner implements MultiTargetLearnerSemiSupervised
Semi-supervised method for online multi-target regression. This method uses the AMRules as learner and it based on probabilistic method very similar to anomaly detection. This method measures predicts the benefit of a unlabeled example to the models(using only the input information) to the model. If this benefit is higher thanthen the algorithm predicts an output and artificially labels the example and use it for training. The algorithm is fully explained in the following publication: Sousa R., Gama J. (2016) Online Semi-supervised Learning for Multi-target Regression in Data Streams Using AMRules. In: Boström H., Knobbe A., Soares C., Papapetrou P. (eds) Advances in Intelligent Data Analysis XV. IDA 2016. Lecture Notes in Computer Science, vol 9897. Springer. - Version:
- $Revision: 2 $
- Author:
- RSousa
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class moa.classifiers.AbstractClassifier
classifierRandom, modelContext, randomSeed, trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description AMRulesMultiLabelLearnerSemiSuper()
AMRulesMultiLabelLearnerSemiSuper(double attributesPercentage)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
debug(String string, int level)
Print to consoleprotected double[]
defaultRuleErrors(Prediction vote)
double
getAttributesPercentage()
protected double
getAverageInputs()
protected double
getAverageOutputs()
void
getModelDescription(StringBuilder out, int indent)
print GUI learn modelprotected Measurement[]
getModelMeasurementsImpl()
print GUI evaluate modelPrediction
getPredictionForInstance(MultiLabelInstance inst)
Prediction
getTrainingPrediction()
ErrorWeightedVoteMultiLabel
getVotes(MultiLabelInstance instance)
getVotes extension of the instance method getVotesForInstance in moa.classifier.java returns the prediction of the instance.boolean
isRandomizable()
Gets whether this learner needs a random seed.protected abstract MultiLabelRule
newDefaultRule()
ErrorWeightedVoteMultiLabel
newErrorWeightedVote()
void
PrintRuleSet()
void
resetLearningImpl()
Resets this classifier.void
setAttributesPercentage(double attributesPercentage)
void
setObserver(ObserverMOAObject observer)
void
setRandomSeed(int randomSeed)
Sets the seed for random number generation.protected void
setRuleOptions(MultiLabelRule rule)
void
trainOnInstanceImpl(MultiLabelInstance instance)
protected void
VerboseToConsole(MultiLabelInstance inst)
-
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, setModelContext, 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, setModelContext, 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
-
ruleSet
protected MultiLabelRuleSet ruleSet
-
defaultRule
protected MultiLabelRule defaultRule
-
ruleNumberID
protected int ruleNumberID
-
statistics
protected double[] statistics
-
observer
protected ObserverMOAObject observer
-
splitConfidenceOption
public FloatOption splitConfidenceOption
-
tieThresholdOption
public FloatOption tieThresholdOption
-
gracePeriodOption
public IntOption gracePeriodOption
-
learnerOption
public ClassOption learnerOption
-
unorderedRulesOption
public FlagOption unorderedRulesOption
-
dropOldRuleAfterExpansionOption
public FlagOption dropOldRuleAfterExpansionOption
-
changeDetector
public ClassOption changeDetector
-
anomalyDetector
public ClassOption anomalyDetector
-
splitCriterionOption
public ClassOption splitCriterionOption
-
errorMeasurerOption
public ClassOption errorMeasurerOption
-
weightedVoteOption
public ClassOption weightedVoteOption
-
numericObserverOption
public ClassOption numericObserverOption
-
nominalObserverOption
public ClassOption nominalObserverOption
-
VerbosityOption
public IntOption VerbosityOption
-
outputSelectorOption
public ClassOption outputSelectorOption
-
inputSelectorOption
public ClassOption inputSelectorOption
-
randomSeedOption
public IntOption randomSeedOption
-
featureRankingOption
public ClassOption featureRankingOption
-
scoreThreshold
public FloatOption scoreThreshold
-
slidingWindowSize
public IntOption slidingWindowSize
-
slidingWindowStep
public IntOption slidingWindowStep
-
attributesPercentage
protected double attributesPercentage
-
prediction
public Prediction prediction
-
numberTotalExamples
public int numberTotalExamples
-
hasModel
public boolean hasModel
-
anomalyDetector2
public AnomalyDetector anomalyDetector2
-
-
Method Detail
-
getAttributesPercentage
public double getAttributesPercentage()
-
setAttributesPercentage
public void setAttributesPercentage(double attributesPercentage)
-
getPredictionForInstance
public Prediction getPredictionForInstance(MultiLabelInstance inst)
- Specified by:
getPredictionForInstance
in interfaceMultiLabelLearner
- Specified by:
getPredictionForInstance
in interfaceMultiTargetLearnerSemiSupervised
- Specified by:
getPredictionForInstance
in classAbstractMultiLabelLearner
-
getVotes
public ErrorWeightedVoteMultiLabel getVotes(MultiLabelInstance instance)
getVotes extension of the instance method getVotesForInstance in moa.classifier.java returns the prediction of the instance.
-
defaultRuleErrors
protected double[] defaultRuleErrors(Prediction vote)
-
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 interfaceMultiTargetLearnerSemiSupervised
- Specified by:
trainOnInstanceImpl
in classAbstractMultiLabelLearner
-
getModelMeasurementsImpl
protected Measurement[] getModelMeasurementsImpl()
print GUI evaluate model- Specified by:
getModelMeasurementsImpl
in classAbstractClassifier
- Returns:
- an array of measurements to be used in evaluation tasks
-
getAverageInputs
protected double getAverageInputs()
-
getAverageOutputs
protected double getAverageOutputs()
-
getModelDescription
public void getModelDescription(StringBuilder out, int indent)
print GUI learn model- Specified by:
getModelDescription
in classAbstractClassifier
- Parameters:
out
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
debug
protected void debug(String string, int level)
Print to console- Parameters:
string
-
-
VerboseToConsole
protected void VerboseToConsole(MultiLabelInstance inst)
-
PrintRuleSet
public void PrintRuleSet()
-
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
-
setRuleOptions
protected void setRuleOptions(MultiLabelRule rule)
-
newDefaultRule
protected abstract MultiLabelRule newDefaultRule()
-
newErrorWeightedVote
public ErrorWeightedVoteMultiLabel newErrorWeightedVote()
-
setRandomSeed
public void setRandomSeed(int randomSeed)
Description copied from interface:Learner
Sets the seed for random number generation.- Specified by:
setRandomSeed
in interfaceLearner<Example<Instance>>
- Overrides:
setRandomSeed
in classAbstractClassifier
- Parameters:
randomSeed
- the seed
-
setObserver
public void setObserver(ObserverMOAObject observer)
-
getTrainingPrediction
public Prediction getTrainingPrediction()
- Specified by:
getTrainingPrediction
in interfaceMultiTargetLearnerSemiSupervised
-
-