net.sf.classifier4J.vector
Class VectorClassifier
java.lang.Object
|
+--net.sf.classifier4J.AbstractClassifier
|
+--net.sf.classifier4J.AbstractCategorizedTrainableClassifier
|
+--net.sf.classifier4J.vector.VectorClassifier
- All Implemented Interfaces:
- ICategorisedClassifier, IClassifier, ITrainable, ITrainableClassifier
- public class VectorClassifier
- extends AbstractCategorizedTrainableClassifier
Method Summary |
double |
classify(java.lang.String category,
java.lang.String input)
Function to determine the probability string matches a criteria for a given
category. |
protected int[] |
generateTermValuesVector(java.lang.String[] terms,
java.util.Map wordFrequencies)
|
boolean |
isMatch(java.lang.String category,
java.lang.String input)
Function to determine if a string matches a criteria for a given category |
void |
teachMatch(java.lang.String category,
java.lang.String input)
|
void |
teachNonMatch(java.lang.String category,
java.lang.String input)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_VECTORCLASSIFIER_CUTOFF
public static double DEFAULT_VECTORCLASSIFIER_CUTOFF
VectorClassifier
public VectorClassifier()
VectorClassifier
public VectorClassifier(TermVectorStorage storage)
classify
public double classify(java.lang.String category,
java.lang.String input)
throws ClassifierException
- Description copied from interface:
ICategorisedClassifier
- Function to determine the probability string matches a criteria for a given
category.
- Parameters:
category
- the category to check againstinput
- the string to classify
- Returns:
- the likelyhood that this string is a match for this net.sf.classifier4J. 1 means 100% likely.
- Throws:
ClassifierException
- If a fatal problem occurs. For example,
the database is unavailable.- See Also:
ICategorisedClassifier.classify(java.lang.String, java.lang.String)
isMatch
public boolean isMatch(java.lang.String category,
java.lang.String input)
throws ClassifierException
- Description copied from interface:
ICategorisedClassifier
- Function to determine if a string matches a criteria for a given category
- Parameters:
category
- the category to check againstinput
- the string to classify
- Returns:
- true if the input string has a probability >= the cutoff probability of
matching
- Throws:
ClassifierException
- If a fatal problem occurs. For example,
the database is unavailable.- See Also:
ICategorisedClassifier.isMatch(java.lang.String, java.lang.String)
teachMatch
public void teachMatch(java.lang.String category,
java.lang.String input)
throws ClassifierException
ClassifierException
- See Also:
ITrainable.teachMatch(java.lang.String, java.lang.String)
generateTermValuesVector
protected int[] generateTermValuesVector(java.lang.String[] terms,
java.util.Map wordFrequencies)
- Parameters:
terms
- wordFrequencies
-
- Returns:
teachNonMatch
public void teachNonMatch(java.lang.String category,
java.lang.String input)
throws ClassifierException
ClassifierException
- See Also:
ITrainable.teachNonMatch(java.lang.String, java.lang.String)
Copyright © 2003-2005 Nick Lothian. All Rights Reserved.