|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttc.TCkNNResult
This class holds the result of an kNN classification given a result of an k nearest neighbor classification for the test documents, the class creates a category ranking for every document
| Nested Class Summary | |
(package private) class |
TCkNNResult.TCkNNCategoryListElement
the elements which will be filled in the array list of the parent class with the two compare functions a category label, scores, and occurences |
| Field Summary | |
(package private) int |
compareMethod
the method of comparison 0: score 1: occurence |
(package private) java.util.ArrayList |
kNNResults
holds the ranking (after sort()) for every(!) category no matter if that category had a nearest neighbor or not |
| Constructor Summary | |
(package private) |
TCkNNResult(java.util.ArrayList categoryLabels)
the constructor creates the arraylist with all the results and initializes the compare method to 0 (score) |
| Method Summary | |
void |
addKNNListElement(TCkNNListElement kNNListElement)
adds an element out of a scoring list ({document, score}) and updates the category scorings, etc. |
java.lang.String |
getCategoryLabelWithRank(int rank)
gets the category label with rank "rank" (called after sort()!!) |
int |
getFirstRankWithScoreSmallerThan(double scr)
returns the first rank whose score is smaller than the given threshold. |
double |
getOccurenceForCategoryLabel(java.lang.String label)
returns the occurence for the category indicated by the label "label" (how often are the k nearest neighor documents labeled as "label") |
int |
getOccurenceOfCategoryWithRank(int rank)
returns how often one category was under the k nearest neighbors |
double |
getScoreForCategoryLabel(java.lang.String label)
returns the score for the category indicated by the label "label" |
double |
getScoreOfCategoryWithRank(int rank)
returns the score of the category with rank "rank" (called after sort())" |
boolean |
isLabeledAs(java.lang.String label,
int rankThreshold)
checks, if the given label "label" was assigned to the document from the kNN classifier, given the rankThreshold (the first rank whose threshold was lower than the threshold for the classifier) |
void |
sort(int cm)
sorts the arraylist with the results for every category according to cm |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
int compareMethod
java.util.ArrayList kNNResults
| Constructor Detail |
TCkNNResult(java.util.ArrayList categoryLabels)
categoryLabels - | Method Detail |
public void addKNNListElement(TCkNNListElement kNNListElement)
kNNListElement - public void sort(int cm)
cm - public java.lang.String getCategoryLabelWithRank(int rank)
rank - the rank
public int getOccurenceOfCategoryWithRank(int rank)
rank - the rank of the category
public double getScoreOfCategoryWithRank(int rank)
rank -
public int getFirstRankWithScoreSmallerThan(double scr)
scr - the score
public double getScoreForCategoryLabel(java.lang.String label)
label - the label of the category
public double getOccurenceForCategoryLabel(java.lang.String label)
label - the label of the category
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 | ||||||||||