org.cleartk.classifier.tksvmlight
Class TKSVMlightBooleanOutcomeClassifierBuilder
java.lang.Object
org.cleartk.classifier.jar.JarClassifierBuilder<CLASSIFIER_TYPE>
org.cleartk.classifier.jar.EncodingJarClassifierBuilder<CLASSIFIER_TYPE,ENCODED_FEATURES_TYPE,OUTCOME_TYPE,ENCODED_OUTCOME_TYPE>
org.cleartk.classifier.jar.ClassifierBuilder_ImplBase<TKSVMlightBooleanOutcomeClassifier,TreeFeatureVector,Boolean,Boolean>
org.cleartk.classifier.tksvmlight.TKSVMlightBooleanOutcomeClassifierBuilder
public class TKSVMlightBooleanOutcomeClassifierBuilder
- extends org.cleartk.classifier.jar.ClassifierBuilder_ImplBase<TKSVMlightBooleanOutcomeClassifier,TreeFeatureVector,Boolean,Boolean>
A class that provided interfaces to train, package and unpackage a
TKSVMlightBooleanOutcomeClassifier into a jar file.
Copyright (c) 2007-2008, Regents of the University of Colorado
All rights reserved.
- Author:
- Daryl Lonnon
| Fields inherited from class org.cleartk.classifier.jar.EncodingJarClassifierBuilder |
featuresEncoder, outcomeEncoder |
| Fields inherited from class org.cleartk.classifier.jar.JarClassifierBuilder |
manifest |
| Methods inherited from class org.cleartk.classifier.jar.EncodingJarClassifierBuilder |
getEncodersFile, getFeaturesEncoder, getOutcomeEncoder, saveToTrainingDirectory, setFeaturesEncoder, setOutcomeEncoder |
| Methods inherited from class org.cleartk.classifier.jar.JarClassifierBuilder |
fromManifest, fromTrainingDirectory, getModelJarFile, loadClassifier, loadClassifierFromTrainingDirectory, packageClassifier, trainAndPackage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COMMAND_ARGUMENT
public static String COMMAND_ARGUMENT
TKSVMlightBooleanOutcomeClassifierBuilder
public TKSVMlightBooleanOutcomeClassifierBuilder()
train
public static void train(String filePath,
String[] args)
throws Exception
- Train a SVMTK classifier. Assumes the executable name is "tk_svm_learn". Note: this is public
so the One verse All TK SVMlight classifier may take advantage of it, casual users probably
shouldn't use this interface.
- Parameters:
args - The arguments to be used by the tk_svm_classify command. Note: -t 5 is used to specify
the use of Tree Kernels.
- Throws:
Exception
getTrainingDataFile
public File getTrainingDataFile(File dir)
- Specified by:
getTrainingDataFile in class org.cleartk.classifier.jar.EncodingJarClassifierBuilder<TKSVMlightBooleanOutcomeClassifier,TreeFeatureVector,Boolean,Boolean>
trainClassifier
public void trainClassifier(File dir,
String... args)
throws Exception
- Train this SVMTK classifier.
- Specified by:
trainClassifier in class org.cleartk.classifier.jar.JarClassifierBuilder<TKSVMlightBooleanOutcomeClassifier>
- Parameters:
dir - The directory where the training data has been written.args - The arguments to be used by the tk_svm_classify command. Note: -t 5 is used to specify
the use of Tree Kernels.
- Throws:
Exception
packageClassifier
protected void packageClassifier(File dir,
JarOutputStream modelStream)
throws IOException
- package the classifier found in dir into the a Jar file.
- Overrides:
packageClassifier in class org.cleartk.classifier.jar.EncodingJarClassifierBuilder<TKSVMlightBooleanOutcomeClassifier,TreeFeatureVector,Boolean,Boolean>
- Throws:
IOException
unpackageClassifier
protected void unpackageClassifier(JarInputStream modelStream)
throws IOException
- unpackage the model files found in a JarInputStream.
- Overrides:
unpackageClassifier in class org.cleartk.classifier.jar.EncodingJarClassifierBuilder<TKSVMlightBooleanOutcomeClassifier,TreeFeatureVector,Boolean,Boolean>
- Throws:
IOException
newClassifier
protected TKSVMlightBooleanOutcomeClassifier newClassifier()
- Create a TKSVMlightClassifier.
- Specified by:
newClassifier in class org.cleartk.classifier.jar.JarClassifierBuilder<TKSVMlightBooleanOutcomeClassifier>
Copyright © 2013. All Rights Reserved.