Package moa.classifiers.rules.multilabel
Class AMRulesMultiLabelLearner
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.AbstractMultiLabelLearner
-
- moa.classifiers.rules.multilabel.AMRulesMultiLabelLearner
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiLabelLearner
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
- Direct Known Subclasses:
AMRulesMultiLabelClassifier
,AMRulesMultiTargetRegressor
public abstract class AMRulesMultiLabelLearner extends AbstractMultiLabelLearner implements MultiLabelLearner
Adaptive Model Rules for MultiLabel problems (AMRulesML), the streaming rule learning algorithm.- Version:
- $Revision: 2$* This algorithm learns ordered and unordered rule set from data streams. Each rule detect anomalies and react to changes by pruning the rule set. This algorithm also does the detection of anomalies.
- Author:
- J. Duarte, J. Gama (jgama@fep.up.pt)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description ClassOption
anomalyDetector
protected double
attributesPercentage
ClassOption
changeDetector
protected MultiLabelRule
defaultRule
FlagOption
dropOldRuleAfterExpansionOption
ClassOption
errorMeasurerOption
ClassOption
featureRankingOption
IntOption
gracePeriodOption
ClassOption
inputSelectorOption
ClassOption
learnerOption
ClassOption
nominalObserverOption
ClassOption
numericObserverOption
protected ObserverMOAObject
observer
ClassOption
outputSelectorOption
IntOption
randomSeedOption
protected int
ruleNumberID
protected MultiLabelRuleSet
ruleSet
FloatOption
splitConfidenceOption
ClassOption
splitCriterionOption
protected double[]
statistics
FloatOption
tieThresholdOption
FlagOption
unorderedRulesOption
IntOption
VerbosityOption
ClassOption
weightedVoteOption
-
Fields inherited from class moa.classifiers.AbstractClassifier
classifierRandom, modelContext, randomSeed, trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description AMRulesMultiLabelLearner()
AMRulesMultiLabelLearner(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)
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
-
attributesPercentage
protected double attributesPercentage
-
-
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 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 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)
-
-