/** * for testing only - takes a data file as input and a data file for the * output. * * @param args the commandline arguments * @throws Exception if something goes wrong */ public static void main(String[] args) throws Exception { if (args.length != 2) { System.out.println("\nUsage: " + DataSource.class.getName() + " <input-file> <output-file>\n"); System.exit(1); } // load data Instances data = DataSource.read(args[0]); // save data DataSink.write(args[1], data); }
/** * for testing only - takes a data file as input and a data file for the * output. * * @param args the commandline arguments * @throws Exception if something goes wrong */ public static void main(String[] args) throws Exception { if (args.length != 2) { System.out.println("\nUsage: " + DataSource.class.getName() + " <input-file> <output-file>\n"); System.exit(1); } // load data Instances data = DataSource.read(args[0]); // save data DataSink.write(args[1], data); }
public static void main(String[] args) throws Exception { if (args.length != 3) throw new IllegalArgumentException("Required parameters: <input> <attribute_indices> <output>"); System.out.println("Loading input data: " + args[0]); Instances input = DataSource.read(args[0]); System.out.println("Applying filter using indices: " + args[1]); MekaClassAttributes filter = new MekaClassAttributes(); filter.setAttributeIndices(args[1]); filter.setInputFormat(input); Instances output = Filter.useFilter(input, filter); System.out.println("Saving filtered data to: " + args[2]); ArffSaver saver = new ArffSaver(); saver.setFile(new File(args[2])); DataSink.write(saver, output); } }
ThresholdCurve tc = new ThresholdCurve(); Instances result = tc.getCurve(testingEvaluation.predictions(), labelIndex); DataSink.write(thresholdFile, result);
ThresholdCurve tc = new ThresholdCurve(); Instances result = tc.getCurve(testingEvaluation.predictions(), labelIndex); DataSink.write(thresholdFile, result);
DataSink.write( aContext.getStorageLocation(OUTPUT_KEY, AccessMode.READWRITE).getAbsolutePath() + "/" + StringUtils.replace(PREDICTIONS_KEY, "#", String.valueOf(n)),
DataSink.write(aContext.getStorageLocation(OUTPUT_KEY, AccessMode.READWRITE) .getAbsolutePath() + "/" + PREDICTIONS_KEY, testData);
AccessMode.READWRITE); File arffDummy = new File(predictionFile.getParent(), "prediction.arff"); DataSink.write(arffDummy.getAbsolutePath(), testData); FileUtils.moveFile(arffDummy, predictionFile);
AccessMode.READWRITE); File arffDummy = new File(predictionFile.getParent(), "prediction.arff"); DataSink.write(arffDummy.getAbsolutePath(), testData); FileUtils.moveFile(arffDummy, predictionFile);
DataSink.write(args[2], performance);
/** * writes the data to the given stream (always in ARFF format). * * @param stream the stream to write the data to (ARFF format) * @param data the data to store * @throws Exception if writing fails */ public static void write(OutputStream stream, Instances data) throws Exception { DataSink sink; sink = new DataSink(stream); sink.write(data); }
/** * writes the data to the given stream (always in ARFF format). * * @param stream the stream to write the data to (ARFF format) * @param data the data to store * @throws Exception if writing fails */ public static void write(OutputStream stream, Instances data) throws Exception { DataSink sink; sink = new DataSink(stream); sink.write(data); }
/** * writes the data via the given saver. * * @param saver the saver to use for writing the data * @param data the data to store * @throws Exception if writing fails */ public static void write(Saver saver, Instances data) throws Exception { DataSink sink; sink = new DataSink(saver); sink.write(data); }
/** * writes the data to the given file. * * @param filename the file to write the data to * @param data the data to store * @throws Exception if writing fails */ public static void write(String filename, Instances data) throws Exception { DataSink sink; sink = new DataSink(filename); sink.write(data); }
/** * writes the data via the given saver. * * @param saver the saver to use for writing the data * @param data the data to store * @throws Exception if writing fails */ public static void write(Saver saver, Instances data) throws Exception { DataSink sink; sink = new DataSink(saver); sink.write(data); }
/** * writes the data to the given file. * * @param filename the file to write the data to * @param data the data to store * @throws Exception if writing fails */ public static void write(String filename, Instances data) throws Exception { DataSink sink; sink = new DataSink(filename); sink.write(data); }