Package moa.classifiers.rules
Class RuleClassifierNBayes
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.rules.RuleClassifier
-
- moa.classifiers.rules.RuleClassifierNBayes
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class RuleClassifierNBayes extends RuleClassifier
This classifier learn ordered and unordered rule set from data stream with naive Bayes learners.This algorithm also does the detection of anomalies.
Learning Decision RuleClassifications from Data Streams, IJCAI 2011, J. Gama, P. Kosina
Parameters:
- -q: The number of instances a leaf should observe before permitting Naive Bayes.
- -p: Minimum value of p
- -t: Tie Threshold
- -c: Split Confidence
- -g: GracePeriod, the number of instances a leaf should observe between split attempts
- -o: Prediction function to use. Ex:FirstHit
- -r: Learn ordered or unordered rule
- Version:
- $Revision: 2 $
- Author:
- P. Kosina, E. Almeida, J. Gama
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description IntOption
nbThresholdOption
-
Fields inherited from class moa.classifiers.rules.RuleClassifier
anomalyDetectionOption, anomalyNumInstThresholdOption, anomalyProbabilityThresholdOption, attributeObservers, attributeObserversGauss, caseAnomaly, caseAnomalySupervised, gracePeriodOption, instance, observedClassDistribution, orderedRulesOption, PminOption, predictionFunctionOption, probabilityThresholdOption, ruleAnomaliesIndex, ruleAnomaliesIndexSupervised, ruleAttribAnomalyStatistics, ruleAttribAnomalyStatisticsSupervised, ruleClassIndex, ruleSet, ruleSetAnomalies, ruleSetAnomaliesSupervised, saveBestEntropy, saveBestEntropyNominalAttrib, saveBestGlobalEntropy, saveBestValGlobalEntropy, saveTheBest, splitConfidenceOption, Supervised, tieThresholdOption, Unsupervised
-
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 RuleClassifierNBayes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double[]
exponential(double[] votes)
protected double[]
firstHitNB(Instance inst)
double[]
getVotesForInstance(Instance inst)
Predicts the class memberships for a given instance.protected double[]
normalize(double[] votes)
protected double[]
weightedMaxNB(Instance inst)
protected double[]
weightedSumNB(Instance inst)
-
Methods inherited from class moa.classifiers.rules.RuleClassifier
checkBestAttrib, computeAnomalySupervised, computeAnomalyUnsupervised, ComputeHoeffdingBound, computeMean, computeProbability, computeSD, createRule, entropy, expandeRule, findBestValEntropy, findBestValEntropyNominalAtt, firstHit, getBestSecondBestEntropy, getCountNominalAttrib, getModelDescription, getModelDescriptionNoAnomalyDetection, getModelMeasurementsImpl, getPurposeString, getRuleMajorityClassIndex, getWeightSeen, initializeRuleStatistics, isRandomizable, mainFindBestValEntropy, manageMemory, newNominalClassObserver, newNumericClassObserver, newNumericClassObserver2, oberversDistribProb, printAnomaliesSupervised, printAnomaliesUnsupervised, resetLearningImpl, round, theBestAttributes, trainOnInstanceImpl, updateRuleAttribStatistics, weightedMax, weightedSum
-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, 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.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
nbThresholdOption
public IntOption nbThresholdOption
-
-
Method Detail
-
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
- Overrides:
getVotesForInstance
in classRuleClassifier
- Parameters:
inst
- the instance to be classified- Returns:
- an array containing the estimated membership probabilities of the test instance in each class
-
firstHitNB
protected double[] firstHitNB(Instance inst)
-
weightedMaxNB
protected double[] weightedMaxNB(Instance inst)
-
weightedSumNB
protected double[] weightedSumNB(Instance inst)
-
normalize
protected double[] normalize(double[] votes)
-
exponential
protected double[] exponential(double[] votes)
-
-