public class NBNode extends ActiveHNode implements LearningNode, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected NaiveBayesUpdateable |
m_bayes
The naive Bayes model at the node
|
protected double |
m_nbWeightThreshold
The weight of instances that need to be seen by this node before allowing
naive Bayes to make predictions
|
m_nodeStats, m_weightSeenAtLastSplitEvalm_parentBranch, m_parentNode, m_theNodem_classDistribution, m_leafNum, m_nodeNum| Constructor and Description |
|---|
NBNode(Instances header,
double nbWeightThreshold)
Construct a new NBNode
|
| Modifier and Type | Method and Description |
|---|---|
protected double[] |
bypassNB(Instance inst,
Attribute classAtt) |
protected int |
dumpTree(int depth,
int leafCount,
java.lang.StringBuffer buff) |
double[] |
getDistribution(Instance inst,
Attribute classAtt)
Return a class probability distribution computed from the frequency counts at this node
|
protected void |
printLeafModels(java.lang.StringBuffer buff) |
void |
updateNode(Instance inst)
Update the node with the supplied instance
|
getPossibleSplitsclassDistributionIsPure, graphTree, installNodeNums, isLeaf, leafForInstance, numEntriesInClassDistribution, toString, totalWeight, updateDistributionprotected NaiveBayesUpdateable m_bayes
protected double m_nbWeightThreshold
public NBNode(Instances header, double nbWeightThreshold) throws java.lang.Exception
header - the instances structure of the data we're learning fromnbWeightThreshold - the weight mass to see before allowing naive Bayes
to predictjava.lang.Exception - if a problem occurspublic void updateNode(Instance inst) throws java.lang.Exception
HNodeupdateNode in class ActiveHNodeinst - the instance to update withjava.lang.Exception - if a problem occursprotected double[] bypassNB(Instance inst, Attribute classAtt) throws java.lang.Exception
java.lang.Exceptionpublic double[] getDistribution(Instance inst, Attribute classAtt) throws java.lang.Exception
HNodegetDistribution in class HNodeinst - the instance to get a prediction forclassAtt - the class attributejava.lang.Exception - if a problem occursprotected int dumpTree(int depth,
int leafCount,
java.lang.StringBuffer buff)
protected void printLeafModels(java.lang.StringBuffer buff)
printLeafModels in class HNode