javax.datamining.modeldetail.naivebayes
Interface NaiveBayesModelDetail

All Superinterfaces:
ModelDetail

public interface NaiveBayesModelDetail
extends ModelDetail

NaiveBayesModelDetail is built by using Bayes' Theorem, combined with a ("naïve") presumption of conditional independence, to build a predictive model using counts of the occurrences of each target value, and counts of the co-occurrences of predictor values with target values.

The values returned from getTargetCount, getPairCount, and getProbability methods are derived from the target-value and co-occurrence counts that constitute the Naive Bayes predictive model.

Author:
JSR-73 Java Data Mining Expert Group
See Also:
ModelDetail

Method Summary
 int getCount(java.lang.String attributeName, java.lang.Object attributeValue)
          Returns the number of occurrences in the training data of the specified attribute having the specified value, if NaiveBayesSettings.supportsCapability(NaiveBayesCapability.singletonCount) returns true.
 int getPairCount(java.lang.String attributeName, java.lang.Object predictorValue, java.lang.Object targetValue)
          Returns the number of occurrences in the training data of the specified attribute having the specified value in a case in which the target attribute has the specified target value.
 double getPairProbability(java.lang.String attributeName, java.lang.Object predictorValue, java.lang.Object targetValue)
          Returns the conditional probability of the specified predictor attribute having the specifiedvalue given that the target attribute has the specified target value.
 long getTargetCount(java.lang.Object targetValue)
          Returns the count for the specified target value, i.e., the number of occurrences in the training data of the target attribute having the specified value.
 double getTargetProbability(java.lang.Object targetValue)
          Returns the probability of the specified target value, i.e., the probability of the target to appear in the training data.
 

Method Detail

getCount

public int getCount(java.lang.String attributeName,
                    java.lang.Object attributeValue)
             throws JDMException
Returns the number of occurrences in the training data of the specified attribute having the specified value, if NaiveBayesSettings.supportsCapability(NaiveBayesCapability.singletonCount) returns true. Otherwise, the returned value is undefined.

Parameters:
attributeName - The logical attribute name to count the frequency of the specified value.
attributeValue - The value of the attribute whose count is to be returned.
Returns:
int
Throws:
JDMException

getPairCount

public int getPairCount(java.lang.String attributeName,
                        java.lang.Object predictorValue,
                        java.lang.Object targetValue)
                 throws JDMException
Returns the number of occurrences in the training data of the specified attribute having the specified value in a case in which the target attribute has the specified target value.

Parameters:
attributeName - The logical attribute name to count the frequency of the specified pair.
predictorValue -
targetValue -
Returns:
int
Throws:
JDMException

getPairProbability

public double getPairProbability(java.lang.String attributeName,
                                 java.lang.Object predictorValue,
                                 java.lang.Object targetValue)
                          throws JDMException
Returns the conditional probability of the specified predictor attribute having the specifiedvalue given that the target attribute has the specified target value.

Parameters:
attributeName - The logical attribute name to count the probability of the specified pair.
predictorValue -
targetValue -
Returns:
double
Throws:
JDMException

getTargetCount

public long getTargetCount(java.lang.Object targetValue)
                    throws JDMException
Returns the count for the specified target value, i.e., the number of occurrences in the training data of the target attribute having the specified value.

Parameters:
targetValue - The target value whose count is to be returned.
Returns:
long
Throws:
JDMException

getTargetProbability

public double getTargetProbability(java.lang.Object targetValue)
                            throws JDMException
Returns the probability of the specified target value, i.e., the probability of the target to appear in the training data.

Parameters:
targetValue - The target value whose count is to be returned.
Returns:
double
Throws:
JDMException