Naive Bayes  0.0.1
 All Classes Files Functions Variables Pages
Public Member Functions | Protected Member Functions | List of all members
NaiveBayes Class Reference
Inheritance diagram for NaiveBayes:
TAN

Public Member Functions

 NaiveBayes ()
 
void learn (DataSet trainSet)
 
boolean classify (DataSet testSet)
 

Protected Member Functions

void printStructure ()
 
ClassifyResult classify (String[] attributeValue)
 

Detailed Description

Naive Bayes classifier. After create an instance, need to train first and then classify

Constructor & Destructor Documentation

NaiveBayes.NaiveBayes ( )
inline

Constructor. Don't do too much, just create lists. Need to call learn() on trainSet to build classifer

Member Function Documentation

boolean NaiveBayes.classify ( DataSet  testSet)
inline

Classify a data set, print out the results and accuracy

Parameters
testSetdata set to classify
Returns
true if successfully classified. False if the network is not yet built.
ClassifyResult NaiveBayes.classify ( String[]  attributeValue)
inlineprotected

Given an array of attributes, classify it with trained bayes net, return the classification

Parameters
attributeValueAn array of attribute values
Returns
classification result, including the label and probability
void NaiveBayes.learn ( DataSet  trainSet)
inline

Learn probability table from training instances

Parameters
trainSettraining data set
Returns
true if training is success, otherwise false;
void NaiveBayes.printStructure ( )
inlineprotected

Print structure


The documentation for this class was generated from the following file: