org.cleartk.classifier.tksvmlight
Class TKSVMlightStringOutcomeDataWriter

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<TKSVMlightStringOutcomeClassifierBuilder,TreeFeatureVector,String,Integer>
              extended by org.cleartk.classifier.tksvmlight.TKSVMlightStringOutcomeDataWriter
All Implemented Interfaces:
org.cleartk.classifier.DataWriter<String>

public class TKSVMlightStringOutcomeDataWriter
extends org.cleartk.classifier.jar.DataWriter_ImplBase<TKSVMlightStringOutcomeClassifierBuilder,TreeFeatureVector,String,Integer>


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
TKSVMlightStringOutcomeDataWriter(File outputDirectory)
          Constructor for the One verse All Tree Kernel SVMlight data writer.
 
Method Summary
 void finish()
          Callback called after the last feature vector has been written.
protected  TKSVMlightStringOutcomeClassifierBuilder newClassifierBuilder()
           
 void writeEncoded(TreeFeatureVector features, Integer outcome)
          Write the feature vector into the appropriate files (ultimately, it's one line in each of the model file.)
 
Methods inherited from class org.cleartk.classifier.jar.DataWriter_ImplBase
write
 
Methods inherited from class org.cleartk.classifier.jar.EncodingDirectoryDataWriter
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
 

Constructor Detail

TKSVMlightStringOutcomeDataWriter

public TKSVMlightStringOutcomeDataWriter(File outputDirectory)
                                  throws IOException
Constructor for the One verse All Tree Kernel SVMlight data writer.

Throws:
IOException
Method Detail

writeEncoded

public void writeEncoded(TreeFeatureVector features,
                         Integer outcome)
                  throws org.cleartk.classifier.CleartkProcessingException
Write the feature vector into the appropriate files (ultimately, it's one line in each of the model file.)

Specified by:
writeEncoded in class org.cleartk.classifier.jar.DataWriter_ImplBase<TKSVMlightStringOutcomeClassifierBuilder,TreeFeatureVector,String,Integer>
Parameters:
features - The feature vector to be written.
outcome - The index of the model file which this feature vector corresponds to. If null this feature vector has no known "outcome".
Throws:
org.cleartk.classifier.CleartkProcessingException

finish

public void finish()
            throws org.cleartk.classifier.CleartkProcessingException
Callback called after the last feature vector has been written. Flushes the various streams and deletes the all false file.

Specified by:
finish in interface org.cleartk.classifier.DataWriter<String>
Overrides:
finish in class org.cleartk.classifier.jar.EncodingDirectoryDataWriter<TKSVMlightStringOutcomeClassifierBuilder,org.cleartk.classifier.Classifier<String>,TreeFeatureVector,String,Integer>
Throws:
org.cleartk.classifier.CleartkProcessingException

newClassifierBuilder

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


Copyright © 2013. All Rights Reserved.