|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjncc20.NaiveClassifier
public abstract class NaiveClassifier
Abstract super-class for Naive Classifiers
Nested Class Summary | |
---|---|
protected static class |
NaiveClassifier.Feature
Helper class for Naive Classifiers, that implements Mar and NonMar features. |
protected class |
NaiveClassifier.OutputClass
Helper class for Naive Classifiers, that implements the output class of the classification problem. |
Field Summary | |
---|---|
protected NaiveClassifier.Feature[] |
featureSet
Array of Feature objects, that represents the feature set of the classifier |
protected NaiveClassifier.OutputClass[] |
outputClasses
Array of OutputClass objects, that represents the possible output classes of the problem |
protected int |
s
number of "hidden" observations, that rules the weights of the prior with respect to the likelihood. |
Constructor Summary | |
---|---|
NaiveClassifier()
Empty constructor, needed to compile |
|
NaiveClassifier(java.util.ArrayList<int[]> TrainingSet,
java.util.ArrayList<java.lang.String> FeatureNames,
java.util.ArrayList<java.lang.String> classNames,
java.util.ArrayList<java.lang.Integer> numClassForEachFeature)
Initializes all features and output classes; computes all the relevant frequencies on the training set |
Method Summary | |
---|---|
protected void |
buildFeatureSet(java.util.ArrayList<int[]> TrainingSet,
java.util.ArrayList<java.lang.String> FeatureNames,
int NumOfClasses,
java.util.ArrayList<java.lang.Integer> NumClassForEachFeature,
int priorCounts)
Instantiates the FeatureSet, by computing all the relevant frequencies of all features on the training set. |
protected void |
buildOutputClasses(java.util.ArrayList<int[]> TrainingSet,
java.util.ArrayList<java.lang.String> ClassNames,
int priorCounts)
Instantiates class names and frequencies of the OutputClass; frequencies are initialized to the value specified by priorCounts (1 for NBC, 0 for NCC) |
(package private) NaiveClassifier.OutputClass[] |
getOutputClasses()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NaiveClassifier.Feature[] featureSet
protected NaiveClassifier.OutputClass[] outputClasses
protected int s
Constructor Detail |
---|
NaiveClassifier()
NaiveClassifier(java.util.ArrayList<int[]> TrainingSet, java.util.ArrayList<java.lang.String> FeatureNames, java.util.ArrayList<java.lang.String> classNames, java.util.ArrayList<java.lang.Integer> numClassForEachFeature)
Method Detail |
---|
protected void buildFeatureSet(java.util.ArrayList<int[]> TrainingSet, java.util.ArrayList<java.lang.String> FeatureNames, int NumOfClasses, java.util.ArrayList<java.lang.Integer> NumClassForEachFeature, int priorCounts)
the bivariates count n(a_i,c_j), that correspond to the occurences ignoring missing data for NBC, and to the lower counts for NCC;
for each output class, the number of missing data of the current feature, needed to then compute the upper counts for NCC
protected void buildOutputClasses(java.util.ArrayList<int[]> TrainingSet, java.util.ArrayList<java.lang.String> ClassNames, int priorCounts)
NaiveClassifier.OutputClass[] getOutputClasses()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |