public static MLDataSet loadCSVTOMemory(CSVFormat format,
String filename, boolean headers, int inputSize, int idealSize) {
MLDataSet result = new BasicMLDataSet();
ReadCSV csv = new ReadCSV(filename, headers, format);
while (csv.next()) {
MLData input = null;
MLData ideal = null;
int index = 0;
input = new BasicMLData(inputSize);
for (int i = 0; i < inputSize; i++) {
double d = csv.getDouble(index++);
input.setData(i, d);
}
if (idealSize > 0) {
ideal = new BasicMLData(idealSize);
for (int i = 0; i < idealSize; i++) {
double d = csv.getDouble(index++);
ideal.setData(i, d);
}
}
MLDataPair pair = new BasicMLDataPair(input, ideal);
result.add(pair);