org.cleartk.classifier.tksvmlight
Class TKSVMlightBooleanOutcomeDataWriter

java.lang.Object
  extended by org.cleartk.classifier.jar.DirectoryDataWriter<CLASSIFIER_BUILDER_TYPE,CLASSIFIER_TYPE>
      extended by org.cleartk.classifier.jar.EncodingDirectoryDataWriter<CLASSIFIER_BUILDER_TYPE,org.cleartk.classifier.Classifier<OUTCOME_TYPE>,ENCODED_FEATURES_TYPE,OUTCOME_TYPE,ENCODED_OUTCOME_TYPE>
          extended by org.cleartk.classifier.jar.DataWriter_ImplBase<TKSVMlightBooleanOutcomeClassifierBuilder,TreeFeatureVector,Boolean,Boolean>
              extended by org.cleartk.classifier.tksvmlight.TKSVMlightBooleanOutcomeDataWriter
All Implemented Interfaces:
org.cleartk.classifier.DataWriter<Boolean>

public class TKSVMlightBooleanOutcomeDataWriter
extends org.cleartk.classifier.jar.DataWriter_ImplBase<TKSVMlightBooleanOutcomeClassifierBuilder,TreeFeatureVector,Boolean,Boolean>

The data writer for tree kernel svm light.
Copyright (c) 2009, Regents of the University of Colorado
All rights reserved.

Author:
Daryl Lonnon

Field Summary
 
Fields inherited from class org.cleartk.classifier.jar.EncodingDirectoryDataWriter
trainingDataFile, trainingDataWriter
 
Fields inherited from class org.cleartk.classifier.jar.DirectoryDataWriter
classifierBuilder, outputDirectory
 
Constructor Summary
TKSVMlightBooleanOutcomeDataWriter(File outputDirectory)
          Constructor for the Tree Kernel SVM Light data writer.
 
Method Summary
static String createString(TreeFeatureVector features)
          creates and formats a string (without the outcome) for a specific feature vector.
protected  TKSVMlightBooleanOutcomeClassifierBuilder newClassifierBuilder()
           
 void writeEncoded(TreeFeatureVector features, Boolean outcome)
          Write a line representing the feature vector with the appropriate outcome to be used by the tk_svm_classify command.
 
Methods inherited from class org.cleartk.classifier.jar.DataWriter_ImplBase
write
 
Methods inherited from class org.cleartk.classifier.jar.EncodingDirectoryDataWriter
finish, setFeaturesEncoder, setOutcomeEncoder
 
Methods inherited from class org.cleartk.classifier.jar.DirectoryDataWriter
getClassifierBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cleartk.classifier.DataWriter
finish
 

Constructor Detail

TKSVMlightBooleanOutcomeDataWriter

public TKSVMlightBooleanOutcomeDataWriter(File outputDirectory)
                                   throws IOException
Constructor for the Tree Kernel SVM Light data writer.

Parameters:
outputDirectory - The directory the data/files should be written within.
Throws:
IOException
Method Detail

createString

public static String createString(TreeFeatureVector features)
                           throws org.cleartk.classifier.CleartkProcessingException
creates and formats a string (without the outcome) for a specific feature vector. Public so that the one versus all data writer may use it, not for casual use.

Parameters:
features - The featuers to write into a string format.
Returns:
The string that represents the features in a format that tk_svm_classify can utilize.
Throws:
org.cleartk.classifier.CleartkProcessingException

writeEncoded

public void writeEncoded(TreeFeatureVector features,
                         Boolean outcome)
                  throws org.cleartk.classifier.CleartkProcessingException
Write a line representing the feature vector with the appropriate outcome to be used by the tk_svm_classify command.

Specified by:
writeEncoded in class org.cleartk.classifier.jar.DataWriter_ImplBase<TKSVMlightBooleanOutcomeClassifierBuilder,TreeFeatureVector,Boolean,Boolean>
Parameters:
features - The feature vector to be written.
outcome - The correct classification for that feature vector.
Throws:
org.cleartk.classifier.CleartkProcessingException

newClassifierBuilder

protected TKSVMlightBooleanOutcomeClassifierBuilder newClassifierBuilder()
Specified by:
newClassifierBuilder in class org.cleartk.classifier.jar.DirectoryDataWriter<TKSVMlightBooleanOutcomeClassifierBuilder,org.cleartk.classifier.Classifier<Boolean>>


Copyright © 2013. All Rights Reserved.