public MLDataSet getTrainingData(String csvfile) throws IOException {
                File f = new File(csvfile);
                int lncount = 0;
                FileReader fs = new FileReader(f);
                BufferedReader br = new BufferedReader(fs);
                br.readLine();
                while (br.readLine() != null) {
                        lncount++;
                }
                if (f.isFile()) {
                        ReadCSV reader = new ReadCSV(csvfile,true,',');
                        // System.out.println(reader.getColumnNames());
                        int columns = reader.getColumnNames().size();
                        if (columns > 0) {
                                INPUT = new double[lncount][columns];
                                IDEAL = new double[lncount][columns];
                                int j = 0;
                                FileReader fs2 = new FileReader(f);
                                BufferedReader br2 = new BufferedReader(fs2);
                                br2.readLine();
                                String row = br2.readLine();
                                while (row != null) {
                                        String[] splitted = row.split(",");
                                        for (int i = 0; i < columns -1; i++) {
                        //                        System.out.println("Feature " + (i+1) +": "+ splitted[i]+" ");
                                                INPUT[j][i] = Double.parseDouble(splitted[i]);
                                        }
                        //                System.out.println("Result: "+splitted[columns-1]);
                                        IDEAL[j][0] = Double.parseDouble(splitted[columns-1]);
                                        row = br2.readLine();
                                        j++;
                        }
                                br.close();
                                br2.close();
                                return new BasicMLDataSet(INPUT, IDEAL);
                        }
                        System.out.println("Something went wrong, no training data there.");
                        br.close();
                        return null;
                }
                else {
                        System.out.println("Couldn't find training data.");
                        br.close();
                        return null;
                }
        }