Here you can find the source of loadTrainingData(Path path, List
public static void loadTrainingData(Path path, List<float[]> input, List<float[]> output, int outputCount) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Collections; import java.util.List; import java.util.Random; public class Main { public static void loadTrainingData(Path path, List<float[]> input, List<float[]> output, int outputCount) throws IOException { List<String> lines = Files.readAllLines(path); Collections.shuffle(lines, new Random(System.nanoTime())); for (int i = 0; i < lines.size(); i++) { String[] pieces = lines.get(i).split("\\s"); float[] tmpInput = new float[pieces.length - outputCount]; float[] tmpOutput = new float[outputCount]; for (int k = 0; k < pieces.length - outputCount; k++) { tmpInput[k] = Float.parseFloat(pieces[k]); }/*from w ww . java 2 s . c om*/ for (int k = 0; k < outputCount; k++) { tmpOutput[k] = Float.parseFloat(pieces[k + (pieces.length - outputCount)]); } input.add(tmpInput); output.add(tmpOutput); } } }