8889909192939495969798
final BufferedNeuralDataSet buffer = new BufferedNeuralDataSet(binFile); buffer.beginLoad(inputCount, outputCount); for (final MLDataPair pair : csv) { buffer.add(pair); } buffer.endLoad(); } /** * Load CSV to memory. * @param filename The CSV file to load.
331332333334335336337338339340341
buffer.beginLoad(inputCount, outputCount); for(MLDataPair pair : csv) { buffer.add(pair); } buffer.endLoad(); } public static void convertCSV2Binary(File csvFile, CSVFormat format, File binFile, int[] input, int[] ideal, boolean headers)
363364365366367368369370371372373
// add to dataset buffer.add(inputData,idealData); } buffer.endLoad(); } public static double calculateRegressionError(MLRegression method, MLDataSet data) {
4748495051525354555657
for(int i=0;i<XOR.XOR_INPUT.length;i++) { BasicMLData input = new BasicMLData(XOR.XOR_INPUT[i]); BasicMLData ideal = new BasicMLData(XOR.XOR_IDEAL[i]); set.add(input,ideal); } set.endLoad(); XOR.testXORDataSet(set); } }
107108109110111112113114115116117
output); trainingData.beginLoad(input, output); for (int i = 0; i < elements; i++) { trainingData.add(pair); } trainingData.endLoad(); } } private static void createNewPopulation(File path) { NewPopulationDialog dialog = new NewPopulationDialog();