jncc20
Class NaiveClassifier.Feature

java.lang.Object
  extended by jncc20.NaiveClassifier.Feature
Enclosing class:
NaiveClassifier

protected static class NaiveClassifier.Feature
extends java.lang.Object

Helper class for Naive Classifiers, that implements Mar and NonMar features. Features are characterized by the bivariate counts of their effective occurrences (Frequencies), by the number of missing data for each output class (Missing) and by the logarithm of conditioned probabilities (LogProbability)


Field Summary
private  int[][] frequencies
          Counts that correspond to counts-after-dropping-missing for MarFeatures, bivariate count: frequency are computed for each output class and for each class of the feature.
private  double[][] logProbability
          Logarithm of conditioned probabilities: Log(P(ai|c))
private  int[] missing
          How many times the feature is missing, for every output class.
private  java.lang.String name
          Name
 
Constructor Summary
NaiveClassifier.Feature(java.lang.String SuppliedName, int[][] SuppliedFrequencies, int[] SuppliedMissing)
          Constructor that copies the name and the frequencies table, and computes the log-probabilities table
 
Method Summary
(package private)  int getClassCountAsMar(int ClassIdx)
           
(package private)  int[][] getFrequencies()
           
(package private)  int[] getFrequencies(int ClassIdx)
           
(package private)  int getFrequencies(int ClassIdx, int FeatureClassIdx)
           
(package private)  double[][] getLogProbability()
           
(package private)  double[] getLogProbability(int ClassIdx)
           
(package private)  double getLogProbability(int ClassIdx, int FeatureValue)
           
(package private)  int[] getMissing()
           
(package private)  int getMissing(int OutputClass)
           
(package private)  java.lang.String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frequencies

private int[][] frequencies
Counts that correspond to counts-after-dropping-missing for MarFeatures, bivariate count: frequency are computed for each output class and for each class of the feature. The rows refer to the different output classes, and the columns to the different feature classes.


logProbability

private double[][] logProbability
Logarithm of conditioned probabilities: Log(P(ai|c))


missing

private int[] missing
How many times the feature is missing, for every output class.


name

private java.lang.String name
Name

Constructor Detail

NaiveClassifier.Feature

NaiveClassifier.Feature(java.lang.String SuppliedName,
                        int[][] SuppliedFrequencies,
                        int[] SuppliedMissing)
Constructor that copies the name and the frequencies table, and computes the log-probabilities table

Method Detail

getClassCountAsMar

int getClassCountAsMar(int ClassIdx)
Returns:
Returns the frequencies for a specified class, computed as counts of those records where the class is the one required and the value of the given MAR feature is not missing

getFrequencies

int[][] getFrequencies()
Returns:
Returns the frequencies.

getFrequencies

int[] getFrequencies(int ClassIdx)
Returns:
Returns the frequencies for a specified class

getFrequencies

int getFrequencies(int ClassIdx,
                   int FeatureClassIdx)
Returns:
Returns the frequencies for a specified class, and for a specified class (range of values) defined within the feature domain

getLogProbability

double[][] getLogProbability()
Returns:
Returns the whole log of cond probability table

getLogProbability

double[] getLogProbability(int ClassIdx)
Returns:
Returns the log of cond probabilities for a specified class

getLogProbability

double getLogProbability(int ClassIdx,
                         int FeatureValue)
Returns:
Returns the log of cond probabilities for a specified class and for a specific value of the feature

getMissing

int[] getMissing()
Returns:
Returns the missing.

getMissing

int getMissing(int OutputClass)
Returns:
Returns the number of missing data for a given output class

getName

java.lang.String getName()
Returns:
Returns the name.