net.sf.jdmf.algorithms.classification
Class BayesAlgorithm

java.lang.Object
  extended by net.sf.jdmf.algorithms.AbstractDataMiningAlgorithm
      extended by net.sf.jdmf.algorithms.classification.BayesAlgorithm
All Implemented Interfaces:
DataMiningAlgorithm

public class BayesAlgorithm
extends AbstractDataMiningAlgorithm

Implements the Naive Bayes classification algorithm as described in Data Mining: Practical Machine Learning Tools and Techniques (Second Edition) by Ian H. Witten and Eibe Frank (Morgan Kaufmann, 2005).

 1. Calculate probabilities for all decision values. The probability for a 
 single decision value is a product of likelihoods calculated for all 
 attribute values in the instance being classified. Each likelihood can be
 defined as: the number of times an attribute value resulted in a particular
 decision value divided by the number of occurences of this decision value.
 The whole product is multiplied by the number of occurences of this decision
 value and divided by the number of instances.  
 2. Output a classification rule based on the decision value with the highest 
 probability.
 
If an attribute is numeric, the likelihood is calculated using its normal distribution. Why naive? Because the algorithm assumes that all attributes are equally important. If the likelihood of an attribute value equals 0, then the whole decision value probability is also 0.

Author:
quorthon
See Also:
AttributeValueProbability

Constructor Summary
BayesAlgorithm()
           
 
Method Summary
 DataMiningModel analyze(InputData inputData)
          Analyzes input data (attributes and decisions) and produces output data (rules, decision trees, clusters, ...).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BayesAlgorithm

public BayesAlgorithm()
Method Detail

analyze

public DataMiningModel analyze(InputData inputData)
Description copied from interface: DataMiningAlgorithm
Analyzes input data (attributes and decisions) and produces output data (rules, decision trees, clusters, ...).

See Also:
DataMiningAlgorithm.analyze(net.sf.jdmf.data.input.InputData)