@Override protected void packageClassifier(File dir, JarOutputStream modelStream) throws IOException { super.packageClassifier(dir, modelStream); JarStreams.putNextJarEntry(modelStream, MODEL_NAME, new File(dir, MODEL_NAME)); }
@Override protected void packageClassifier(File dir, JarOutputStream modelStream) throws IOException { super.packageClassifier(dir, modelStream); JarStreams.putNextJarEntry(modelStream, MODEL_NAME, new File(dir, MODEL_NAME)); }
@Override protected void packageClassifier(File dir, JarOutputStream modelStream) throws IOException { super.packageClassifier(dir, modelStream); JarStreams.putNextJarEntry(modelStream, MODEL_NAME, new File(dir, MODEL_NAME)); }
@Override protected void packageClassifier(File dir, JarOutputStream modelStream) throws IOException { super.packageClassifier(dir, modelStream); JarStreams.putNextJarEntry(modelStream, MODEL_NAME, new File(dir, MODEL_NAME)); }
@Override protected void packageClassifier(File dir, JarOutputStream modelStream) throws IOException { super.packageClassifier(dir, modelStream); File model = new File(dir, DEFAULT_MODEL_FILENAME); File trainingData = new File(dir, "training-data.grmm"); if (!model.exists()) { String msg = "model file \"%s\" not found"; throw new IllegalArgumentException(String.format(msg, model)); } if (!trainingData.exists()) { String msg = "training data file \"%s\" not found"; throw new IllegalArgumentException(String.format(msg, trainingData)); } // handle an outcome example from the training data over to the // classifier // through a special jar-file-entry: LineNumberReader lnr = new LineNumberReader(new FileReader(trainingData)); this.outcomeExample = lnr.readLine().split("----")[0]; lnr.close(); JarStreams.putNextJarEntry(modelStream, JAR_ENTRY_MODEL, model); modelStream.putNextEntry(new JarEntry(JAR_ENTRY_OUTCOME_EXAMPLE)); new ObjectOutputStream(modelStream).writeObject(outcomeExample); }
@Override protected void packageClassifier(File dir, JarOutputStream modelStream) throws IOException { super.packageClassifier(dir, modelStream); File model = new File(dir, DEFAULT_MODEL_FILENAME); File trainingData = new File(dir, "training-data.grmm"); if (!model.exists()) { String msg = "model file \"%s\" not found"; throw new IllegalArgumentException(String.format(msg, model)); } if (!trainingData.exists()) { String msg = "training data file \"%s\" not found"; throw new IllegalArgumentException(String.format(msg, trainingData)); } // handle an outcome example from the training data over to the // classifier // through a special jar-file-entry: LineNumberReader lnr = new LineNumberReader(new FileReader(trainingData)); this.outcomeExample = lnr.readLine().split("----")[0]; lnr.close(); JarStreams.putNextJarEntry(modelStream, JAR_ENTRY_MODEL, model); modelStream.putNextEntry(new JarEntry(JAR_ENTRY_OUTCOME_EXAMPLE)); new ObjectOutputStream(modelStream).writeObject(outcomeExample); }