org.cleartk.classifier.tksvmlight
Class TKSVMlightBooleanOutcomeClassifier

java.lang.Object
  extended by org.cleartk.classifier.jar.EncodingJarClassifier<ENCODED_FEATURES_TYPE,OUTCOME_TYPE,ENCODED_OUTCOME_TYPE>
      extended by org.cleartk.classifier.jar.Classifier_ImplBase<TreeFeatureVector,Boolean,Boolean>
          extended by org.cleartk.classifier.tksvmlight.TKSVMlightBooleanOutcomeClassifier
All Implemented Interfaces:
org.cleartk.classifier.Classifier<Boolean>

public class TKSVMlightBooleanOutcomeClassifier
extends org.cleartk.classifier.jar.Classifier_ImplBase<TreeFeatureVector,Boolean,Boolean>

A Tree Kernel SVM light classifier implementation. All features named with the prefix "TK_" treated as Tree Kernels.
Copyright (c) 2007-2008, Regents of the University of Colorado
All rights reserved.

Author:
Daryl Lonnon
See Also:
TKSVMlightStringOutcomeClassifier

Field Summary
 
Fields inherited from class org.cleartk.classifier.jar.EncodingJarClassifier
featuresEncoder, outcomeEncoder
 
Constructor Summary
TKSVMlightBooleanOutcomeClassifier(org.cleartk.classifier.encoder.features.FeaturesEncoder<TreeFeatureVector> featuresEncoder, org.cleartk.classifier.encoder.outcome.OutcomeEncoder<Boolean,Boolean> outcomeEncoder, File modelFile)
          Constructor
 
Method Summary
 Boolean classify(List<org.cleartk.classifier.Feature> features)
          Classify a features list.
 List<org.cleartk.classifier.ScoredOutcome<Boolean>> score(List<org.cleartk.classifier.Feature> features, int maxResults)
          Score a list of features against the model.
static double tkSvmLightPredict(File mFile, TreeFeatureVector featureVector)
          Predict which side of the line a feature vector resides upon for a particular svm model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TKSVMlightBooleanOutcomeClassifier

public TKSVMlightBooleanOutcomeClassifier(org.cleartk.classifier.encoder.features.FeaturesEncoder<TreeFeatureVector> featuresEncoder,
                                          org.cleartk.classifier.encoder.outcome.OutcomeEncoder<Boolean,Boolean> outcomeEncoder,
                                          File modelFile)
Constructor

Parameters:
featuresEncoder - The features encoder used by this classifier.
outcomeEncoder - The outcome encoder used by this classifier.
modelFile - The file for the model used by this classifier.
Method Detail

classify

public Boolean classify(List<org.cleartk.classifier.Feature> features)
                 throws org.cleartk.classifier.CleartkProcessingException
Classify a features list.

Parameters:
features - The feature list to classify.
Returns:
A Boolean of whether the features match this classification.
Throws:
org.cleartk.classifier.CleartkProcessingException

score

public List<org.cleartk.classifier.ScoredOutcome<Boolean>> score(List<org.cleartk.classifier.Feature> features,
                                                                 int maxResults)
                                                          throws org.cleartk.classifier.CleartkProcessingException
Score a list of features against the model.

Specified by:
score in interface org.cleartk.classifier.Classifier<Boolean>
Overrides:
score in class org.cleartk.classifier.jar.Classifier_ImplBase<TreeFeatureVector,Boolean,Boolean>
Parameters:
features - The features to classify
maxResults - The maximum number of results to return in the list (at most 2).
Returns:
A list of scored outcomes ordered by likelihood.
Throws:
org.cleartk.classifier.CleartkProcessingException

tkSvmLightPredict

public static double tkSvmLightPredict(File mFile,
                                       TreeFeatureVector featureVector)
                                throws org.cleartk.classifier.CleartkProcessingException
Predict which side of the line a feature vector resides upon for a particular svm model.

Parameters:
mFile - The model file to predict against.
featureVector - The feature vector to predict for.
Returns:
A double that represents which side of the line the feature vector resides (negative below, positive above).
Throws:
org.cleartk.classifier.CleartkProcessingException


Copyright © 2013. All Rights Reserved.