|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.classify.ClassProbability
This class holds the counts and probabilities for the features of a single class (classification category).
Constructor Summary | |
ClassProbability(int id)
A constructor that creates an empty ClassProbability of category id. |
|
ClassProbability(int id,
HashMap my_probs)
A constructor that creates a new ClassProbability of category id with the counts from my_probs. |
Method Summary | |
int |
getClassID()
Returns the class_id (classification category). |
double |
getCount(Feature key)
Returns the count of the Feature key. |
Set |
getKeys()
Returns the set of keys in this ClassProbability. |
double |
getPrior()
Returns the prior probability of this class. |
double |
getProb(Feature key)
Returns the probability of the Feature key. |
int |
getSize()
Returns the number of keys in this ClassProbability. |
boolean |
hasProb(Feature key)
Returns true if this key has a probability represented in this class, and false otherwise. |
void |
setCount(Feature key,
double count)
Sets the count of the Feature "key" to "count" |
void |
setPrior(double pri)
Sets the prior probability of this class to "pri". |
void |
setProb(Feature key,
double prob)
Sets the probability of the Feature "key" to "prob" |
void |
setSize(int new_size)
Sets the number of keys in this ClassProbability. |
FeatureSet |
toFeatureSet()
This method converts this ClassProbability to a FeatureSet, which is used for CrossValidation. |
String |
toString()
When you print this Classification probability using System&.out&.println, it simply prints the id and the prior. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClassProbability(int id)
public ClassProbability(int id, HashMap my_probs)
Method Detail |
public double getPrior()
public void setPrior(double pri)
public double getProb(Feature key)
public double getCount(Feature key)
public boolean hasProb(Feature key)
public void setProb(Feature key, double prob)
public void setCount(Feature key, double count)
public Set getKeys()
public int getClassID()
public int getSize()
public void setSize(int new_size)
public String toString()
toString
in class Object
public FeatureSet toFeatureSet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |