Documentation of 'weka.classifiers.trees.ht.NBNodeAdaptive' Java class
NBNodeAdaptive
weka.classifiers.trees.ht

Class NBNodeAdaptive

  • All Implemented Interfaces:
    java.io.Serializable, LearningNode


    public class NBNodeAdaptive
    extends NBNode
    implements LearningNode, java.io.Serializable
    Implements a LearningNode that chooses between using majority class or naive Bayes for prediction
    See Also:
    Serialized Form
    • Constructor Detail

      • NBNodeAdaptive

        public NBNodeAdaptive(Instances header,
                              double nbWeightThreshold)
                       throws java.lang.Exception
        Constructor
        Parameters:
        header - the structure of the instances we're training from
        nbWeightThreshold - the weight mass to see before allowing naive Bayes to predict
        Throws:
        java.lang.Exception - if a problem occurs
    • Method Detail

      • updateNode

        public void updateNode(Instance inst)
                        throws java.lang.Exception
        Description copied from class: HNode
        Update the node with the supplied instance
        Overrides:
        updateNode in class NBNode
        Parameters:
        inst - the instance to update with
        Throws:
        java.lang.Exception - if a problem occurs
      • getDistribution

        public double[] getDistribution(Instance inst,
                                        Attribute classAtt)
                                 throws java.lang.Exception
        Description copied from class: HNode
        Return a class probability distribution computed from the frequency counts at this node
        Overrides:
        getDistribution in class NBNode
        Parameters:
        inst - the instance to get a prediction for
        classAtt - the class attribute
        Returns:
        a class probability distribution
        Throws:
        java.lang.Exception - if a problem occurs

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.