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


Field Summary
static double DEFAULT_VECTORCLASSIFIER_CUTOFF
           
 
Fields inherited from class net.sf.classifier4J.AbstractClassifier
cutoff
 
Fields inherited from interface net.sf.classifier4J.ICategorisedClassifier
DEFAULT_CATEGORY
 
Fields inherited from interface net.sf.classifier4J.IClassifier
DEFAULT_CUTOFF, LOWER_BOUND, NEUTRAL_PROBABILITY, UPPER_BOUND
 
Constructor Summary
VectorClassifier()
           
VectorClassifier(TermVectorStorage storage)
           
 
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 net.sf.classifier4J.AbstractCategorizedTrainableClassifier
classify, teachMatch, teachNonMatch
 
Methods inherited from class net.sf.classifier4J.AbstractClassifier
getMatchCutoff, isMatch, isMatch, setMatchCutoff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.classifier4J.IClassifier
isMatch, isMatch, setMatchCutoff
 

Field Detail

DEFAULT_VECTORCLASSIFIER_CUTOFF

public static double DEFAULT_VECTORCLASSIFIER_CUTOFF
Constructor Detail

VectorClassifier

public VectorClassifier()

VectorClassifier

public VectorClassifier(TermVectorStorage storage)
Method Detail

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 against
input - 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 against
input - 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.