weka.classifiers.trees.ht

## Class NBNode

- java.lang.Object
- - weka.classifiers.trees.ht.HNode
  - - weka.classifiers.trees.ht.LeafNode
    - - weka.classifiers.trees.ht.ActiveHNode
      - - weka.classifiers.trees.ht.NBNode

- All Implemented Interfaces:
    java.io.Serializable, LearningNode
  Direct Known Subclasses:
    NBNodeAdaptive

      public class NBNode
      extends ActiveHNode
      implements LearningNode, java.io.Serializable

  Implements a LearningNode that uses a naive Bayes model
  Version:
    $Revision: 9705 $
  Author:
    Richard Kirkby (rkirkby@cs.waikato.ac.nz), Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class weka.classifiers.trees.ht.ActiveHNode

      `m_weightSeenAtLastSplitEval`

    - ### Fields inherited from class weka.classifiers.trees.ht.LeafNode

      `m_parentBranch, m_parentNode, m_theNode`

    - ### Fields inherited from class weka.classifiers.trees.ht.HNode

      `m_classDistribution`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NBNode(Instances header, double nbWeightThreshold)` Construct a new NBNode

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[]` | `getDistribution(Instance inst, Attribute classAtt)` Return a class probability distribution computed from the frequency counts at this node
    `void` | `updateNode(Instance inst)` Update the node with the supplied instance

    - ### Methods inherited from class weka.classifiers.trees.ht.ActiveHNode

      `getPossibleSplits`

    - ### Methods inherited from class weka.classifiers.trees.ht.HNode

      `classDistributionIsPure, graphTree, installNodeNums, isLeaf, leafForInstance, numEntriesInClassDistribution, toString, totalWeight, updateDistribution`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NBNode

          public NBNode(Instances header,
                        double nbWeightThreshold)
                 throws java.lang.Exception

      Construct a new NBNode
      Parameters:
        `header` - the instances structure of the data we're learning 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 `ActiveHNode`
      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 `HNode`
      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