edu.ksu.cis.kdd.classifier.bayes.naive
Class NaiveBayes

java.lang.Object
  extended byedu.ksu.cis.kdd.classifier.Classifier
      extended byedu.ksu.cis.kdd.classifier.bayes.naive.NaiveBayes

public class NaiveBayes
extends Classifier

Note: Please, this is a very very outdated Naive Bayes classifier. It starts as my class project and it's been out of pace from the current infrastructure.

Note to self: Update this when you have time. Improve performance by doing log instead of simple logarithms.

Author:
Roby Joehanes

Field Summary
protected  java.util.Hashtable attrCounter
           
protected  java.util.Hashtable classAttrCounter
           
 
Fields inherited from class edu.ksu.cis.kdd.classifier.Classifier
classCounter, data, estimator
 
Constructor Summary
NaiveBayes()
           
 
Method Summary
 java.lang.Object build(Table tuples)
           
 java.lang.Object classify(Tuple tuple)
           
 java.util.Hashtable getAttrCounter()
          Returns the attrCounter.
 java.util.Hashtable getAttributeTable()
          Returns the attrCounter.
 java.util.Hashtable getClassAttrCounter()
          Returns the classAttrCounter.
 java.util.Hashtable getClassTable()
          Returns the classCounter.
 Table getData()
          Returns the data.
 void init()
           
 
Methods inherited from class edu.ksu.cis.kdd.classifier.Classifier
getClassSize, getClassTally, getEstimator, getTupleSize, setEstimator, tallyClassValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attrCounter

protected java.util.Hashtable attrCounter

classAttrCounter

protected java.util.Hashtable classAttrCounter
Constructor Detail

NaiveBayes

public NaiveBayes()
Method Detail

build

public java.lang.Object build(Table tuples)
Specified by:
build in class Classifier
See Also:
edu.ksu.cis.kdd.data.Classifier#build(Table)

classify

public java.lang.Object classify(Tuple tuple)
Specified by:
classify in class Classifier
See Also:
edu.ksu.cis.kdd.data.Classifier#classify(Tuple)

getAttributeTable

public java.util.Hashtable getAttributeTable()
Returns the attrCounter.

Returns:
Hashtable

getClassTable

public java.util.Hashtable getClassTable()
Returns the classCounter.

Returns:
Hashtable

getData

public Table getData()
Returns the data.

Overrides:
getData in class Classifier
Returns:
Table

getAttrCounter

public java.util.Hashtable getAttrCounter()
Returns the attrCounter.

Returns:
Hashtable

getClassAttrCounter

public java.util.Hashtable getClassAttrCounter()
Returns the classAttrCounter.

Returns:
Hashtable

init

public void init()
Specified by:
init in class Classifier
See Also:
edu.ksu.cis.kdd.data.Classifier#init()