Package org.cleartk.classifier.liblinear

Examples of org.cleartk.classifier.liblinear.LIBLINEARStringOutcomeDataWriter


      // Collect MinMax stats for feature normalization
      FeatureSelection<String> featureSelection = EventAnnotator.createFeatureSelection(this.featureSelectionThreshold);
      featureSelection.train(instances);
      featureSelection.save(EventAnnotator.createFeatureSelectionURI(directory));
      // now write in the libsvm format
      LIBLINEARStringOutcomeDataWriter dataWriter = new LIBLINEARStringOutcomeDataWriter(directory);
      for (Instance<String> instance : instances) {
        dataWriter.write(featureSelection.transform(instance));
      }
      dataWriter.finish();
    }

    JarClassifierBuilder.trainAndPackage(directory, "-c", "0.05");
  }
View Full Code Here


      // Collect MinMax stats for feature normalization
      FeatureSelection<String> featureSelection = TimeAnnotator.createFeatureSelection(this.featureSelectionThreshold);
      featureSelection.train(instances);
      featureSelection.save(TimeAnnotator.createFeatureSelectionURI(this.getModelDirectory(directory)));
      // now write in the libsvm format
      LIBLINEARStringOutcomeDataWriter dataWriter = new LIBLINEARStringOutcomeDataWriter(this.getModelDirectory(directory));
      for (Instance<String> instance : instances) {
        dataWriter.write(featureSelection.transform(instance));
      }
      dataWriter.finish();
    }
    JarClassifierBuilder.trainAndPackage(this.getModelDirectory(directory), this.trainingArguments);
  }
View Full Code Here

TOP

Related Classes of org.cleartk.classifier.liblinear.LIBLINEARStringOutcomeDataWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.