|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Algorithm
The algorithm interface for implementing variations of bayes Algorithm
| Method Summary | |
|---|---|
ClassifierResult |
classifyDocument(String[] document,
Datastore datastore,
String defaultCategory)
Classify the document and return the Result |
ClassifierResult[] |
classifyDocument(String[] document,
Datastore datastore,
String defaultCategory,
int numResults)
Classify the document and return the top numResults |
double |
documentWeight(Datastore datastore,
String label,
String[] document)
Calculate the document weight as the dot product of document vector and the corresponding weight vector of a particular class |
double |
featureWeight(Datastore datastore,
String label,
String feature)
Get the weighted probability of the feature. |
Collection<String> |
getLabels(Datastore datastore)
Returns the labels in the given Model |
void |
initialize(Datastore datastore)
Initialize the data store and verifies the data in it. |
| Method Detail |
|---|
void initialize(Datastore datastore)
throws InvalidDatastoreException
datastore -
InvalidDatastoreException
ClassifierResult classifyDocument(String[] document,
Datastore datastore,
String defaultCategory)
throws InvalidDatastoreException
document - The document to classifydatastore - The data store(InMemory)defaultCategory - The default category to assign Ties are broken by comparing the category
ClassifierResults.
InvalidDatastoreException
ClassifierResult[] classifyDocument(String[] document,
Datastore datastore,
String defaultCategory,
int numResults)
throws InvalidDatastoreException
numResults
document - The document to classifydatastore - The Datastore (InMemory)defaultCategory - The default category to assignnumResults - The maximum number of results to return, ranked by score. Ties are broken by comparing the
category
ClassifierResults.
InvalidDatastoreException
double featureWeight(Datastore datastore,
String label,
String feature)
throws InvalidDatastoreException
datastore - The Datastore (InMemory)label - The label of the featurefeature - The feature to calc. the prob. for
InvalidDatastoreException
double documentWeight(Datastore datastore,
String label,
String[] document)
datastore - The Datastore (InMemory)label - The label to calculate the probability ofdocument - The document
featureWeight(Datastore, String, String)
Collection<String> getLabels(Datastore datastore)
throws InvalidDatastoreException
datastore - The Datastore (InMemory)
Collection of labels
InvalidDatastoreException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||