|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.bayes.ClassifierContext
public class ClassifierContext
The Classifier Wrapper used for choosing the Algorithm
and Datastore
Constructor Summary | |
---|---|
ClassifierContext(Algorithm algorithm,
Datastore datastore)
|
Method Summary | |
---|---|
ClassifierResult |
classifyDocument(String[] document,
String defaultCategory)
Classify the document and return the Result |
ClassifierResult[] |
classifyDocument(String[] document,
String defaultCategory,
int numResults)
Classify the document and return the top numResults |
Collection<String> |
getLabels()
Gets the labels in the given model |
void |
initialize()
Initializes the Context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassifierContext(Algorithm algorithm, Datastore datastore)
Method Detail |
---|
public void initialize() throws InvalidDatastoreException
InvalidDatastoreException
public ClassifierResult classifyDocument(String[] document, String defaultCategory) throws InvalidDatastoreException
document
- The document to classifydefaultCategory
- The default category to assign Ties are broken by comparing the category
ClassifierResult
s.
InvalidDatastoreException
public ClassifierResult[] classifyDocument(String[] document, String defaultCategory, int numResults) throws InvalidDatastoreException
numResults
document
- The document to classifydefaultCategory
- The default category to assignnumResults
- The maximum number of results to return, ranked by score. Ties are broken by comparing the
category
ClassifierResult
s.
InvalidDatastoreException
public Collection<String> getLabels() throws InvalidDatastoreException
InvalidDatastoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |