|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttc.TCNaiveBayesResult
this class holds the result of a naive bayes classification for ONE document "probability" in this context is always the probability that the document was "created" by the category
| Nested Class Summary | |
(package private) class |
TCNaiveBayesResult.TCBayesCategoryListElement
holds the scores, probabilities etc. |
| Field Summary | |
(package private) java.util.ArrayList |
bayesResults
holds the TCBayesCategoryListElements for every category |
(package private) int |
testDocumentIndex
the test document index, if the result if used for a test document |
| Constructor Summary | |
(package private) |
TCNaiveBayesResult(int index)
constructor of a result class for a naive bayes category ranking |
| Method Summary | |
void |
addBayesCategoryResult(java.lang.String categoryLabel,
double probability)
adds a result for one category. |
java.lang.String |
getCategoryLabelWithRank(int rank)
returns the category label with rank "rank". |
int |
getFirstRankWithScoreSmallerThan(double pr)
method to determine a variable threshold for RCut |
double |
getProbabilityForCategory(java.lang.String clabel)
returns the probability for the category with label "clabel" |
double |
getProbabilityOfCategoryWithRank(int rank)
returns the probability of the category with rank "rank" |
boolean |
isLabeledAs(java.lang.String label,
int rankThreshold)
checks, if the given label "label" was assigned to the document from the naive bayes classifier, given the rankThreshold (the first rank whose threshold was lower than the threshold for the classifier) |
void |
normalize(double nf)
normalizes the probabilities (so that the probabilities that the document was created by the category is <= P(C_i)) |
void |
sort()
sorts the arraylist containing the results for all categories according to their probabilities that the document was created by this category (highest value gets index 0 and so on) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
int testDocumentIndex
java.util.ArrayList bayesResults
| Constructor Detail |
TCNaiveBayesResult(int index)
| Method Detail |
public void addBayesCategoryResult(java.lang.String categoryLabel,
double probability)
categoryLabel - the label of the categoryprobability - the probability that the document this instance belongs to
was created by the category which is addedpublic void normalize(double nf)
nf - public void sort()
public java.lang.String getCategoryLabelWithRank(int rank)
rank - the rank of the category
public double getProbabilityForCategory(java.lang.String clabel)
clabel - the label of the category
public double getProbabilityOfCategoryWithRank(int rank)
rank - the rank of the category
public int getFirstRankWithScoreSmallerThan(double pr)
pr - the probability threshold
public boolean isLabeledAs(java.lang.String label,
int rankThreshold)
label - the label of the categoryrankThreshold - the rank threshold
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||