|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttc.TCCategory
This class represents a category. It has a vector of documents belonging to the category and methods to calculate the naive bayes value, the kNN value for it's documents, ...
| Field Summary | |
private java.util.ArrayList |
allTerms
all the unique terms belonging to this category |
(package private) int |
categoryIndex
the index of the category (has not necessarily to be provided) |
(package private) java.lang.String |
categoryLabel
the label of the category |
(package private) int |
numberOfDocuments
the number of documents belonging to this category |
(package private) int |
numberOfProcessedWords
number of processed words for this category |
(package private) double |
numberOfWordsPerDocument
the average number of words per document |
| Constructor Summary | |
TCCategory(int cIndex,
java.lang.String cLabel)
|
|
| Method Summary | |
void |
addDocument(TCDocument newDocument)
adds a new document to the category |
int |
compareTo(java.lang.Object arg0)
The categories are compared using the number of documents belonging to the ctageories |
double |
computeNaiveBayesBernoulli(java.util.ArrayList corpusAllTermsOfInterest,
TCDocument documentToClassify)
computes the naive bayes (bernoulli) value for this category given all the terms of interest in the entire corpus and the document to classify by the naive bayes agorithm |
boolean |
equals(java.lang.Object arg0)
The label of the category is the unique "index" |
java.util.ArrayList |
getAllTerms()
retruns the ArrayList with all unique terms in the category |
java.lang.String |
getCategoryLabel()
returns the category label (the unique index of the category) |
int |
getNumberOfDocuments()
returns the number of documents |
int |
getNumberOfProcessedWords()
|
double |
getNumberOfWordsPerDocument()
|
void |
removeTerm(TCTerm term)
remove the given term in the category and in all documents belonging to the category (recursive) (NOT USED ANYWHERE) |
void |
setWordsPerDocument(double wpd)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.lang.String categoryLabel
int categoryIndex
private java.util.ArrayList allTerms
int numberOfDocuments
int numberOfProcessedWords
double numberOfWordsPerDocument
| Constructor Detail |
public TCCategory(int cIndex,
java.lang.String cLabel)
| Method Detail |
public java.lang.String getCategoryLabel()
public java.util.ArrayList getAllTerms()
public int getNumberOfDocuments()
public double getNumberOfWordsPerDocument()
public int getNumberOfProcessedWords()
public void setWordsPerDocument(double wpd)
public double computeNaiveBayesBernoulli(java.util.ArrayList corpusAllTermsOfInterest,
TCDocument documentToClassify)
corpusAllTermsOfInterest - all the unique terms in the corpusdocumentToClassify - the document to classify
public void removeTerm(TCTerm term)
term - the term to removepublic boolean equals(java.lang.Object arg0)
public int compareTo(java.lang.Object arg0)
compareTo in interface java.lang.Comparable
public void addDocument(TCDocument newDocument)
throws java.lang.CloneNotSupportedException
newDocument - the new document
java.lang.CloneNotSupportedException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||