Class 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 Detail

      • nbThresholdOption

        public IntOption nbThresholdOption
    • Constructor Detail

      • RuleClassifierNBayes

        public RuleClassifierNBayes()
    • 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 interface Classifier
        Overrides:
        getVotesForInstance in class RuleClassifier
        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)