src/core/preprocess/ReadCSVFile.java
public static HashMap<Integer, HashMap<Integer, MMatrix>> readFile(String fileName, String separator, HashSet<Integer> inputColumns, HashSet<Integer> outputColumns, int skipRowsFromStart, boolean asSparseMatrix, boolean inAs2D, int inRows, int inCols, boolean outAs2D, int outRows, int outCols) throws FileNotFoundException {
        HashMap<Integer, Integer> inputColumnMap = new HashMap<>();
        HashMap<Integer, Integer> outputColumnMap = new HashMap<>();
        int index;
        index = 0;

        for (Integer pos : inputColumns) inputColumnMap.put(pos, index++);

        index = 0;
        for (Integer pos : outputColumns) outputColumnMap.put(pos, index++);

        inRows = inAs2D ? inRows : inputColumnMap.size();
        inCols = inAs2D ? inCols : 1;

        outRows = outAs2D ? outRows : outputColumnMap.size();
        outCols = outAs2D ? outCols : 1;

        File file = new File(fileName);
        Scanner scanner = new Scanner(file);

        int countSkipRows = 0;
        while (countSkipRows++ < skipRowsFromStart && scanner.hasNextLine()) scanner.nextLine();

        HashMap<Integer, MMatrix> inputData = new HashMap<>();
        HashMap<Integer, MMatrix> outputData = new HashMap<>();

        int row = 0;
        while (scanner.hasNextLine()) {
            String[] items = scanner.nextLine().split(separator);

            addItem(items, inputColumnMap, row, inAs2D, inRows, inCols, asSparseMatrix, inputData);

            addItem(items, outputColumnMap, row, outAs2D, outRows, outCols, asSparseMatrix, outputData);

            row++;
        }
        HashMap<Integer, HashMap<Integer, MMatrix>> result = new HashMap<>();
        result.put(0, inputData);
        result.put(1, outputData);
        return result;
    }
/**
     * Reads CVS file and transforms comma separated data as input and output sample set.<br>
     * Separates each value separated by separator to own column.<br>
     * Returns input matrix with hash map index 0 and output matrix with hash map index 1.<br>
     *
     * @param fileName name of file to be read.
     * @param separator separator that separates values.
     * @param inputColumns columns to be used for input samples.
     * @param outputColumns columns to be used for output samples.
     * @param skipRowsFromStart skips this number of rows from start.
     * @param asSparseMatrix returns sample set as sparse matrix (SMatrix).
     * @param inAs2D assumes two dimensional input such as image.
     * @param inRows number of input rows.
     * @param inCols number of input cols (relevant for 2D input).
     * @param outAs2D assumes two dimensional output such as image.
     * @param outRows number of output rows.
     * @param outCols number of output cols (relevant for 2D output).
     * @return structure containing input and output matrices.
     * @throws FileNotFoundException throws exception if file is not found.
     */
Reads CVS file and transforms comma separated data as input and output sample set.
Separates each value separated by separator to own column.
Returns input matrix with hash map index 0 and output matrix with hash map index 1.

@param fileName name of file to be read.
@param separator separator that separates values.
@param inputColumns columns to be used for input samples.
@param outputColumns columns to be used for output samples.
@param skipRowsFromStart skips this number of rows from start.
@param asSparseMatrix returns sample set as sparse matrix (SMatrix).
@param inAs2D assumes two dimensional input such as image.
@param inRows number of input rows.
@param inCols number of input cols (relevant for 2D input).
@param outAs2D assumes two dimensional output such as image.
@param outRows number of output rows.
@param outCols number of output cols (relevant for 2D output).
@return structure containing input and output matrices.
@throws FileNotFoundException throws exception if file is not found.
Reads CVS file and transforms comma separated data as input and output sample set . Separates each value separated by separator to own column . Returns input matrix with hash map index 0 and output matrix with hash map index 1 . @param fileName name of file to be read . @param separator separator that separates values . @param inputColumns columns to be used for input samples . @param outputColumns columns to be used for output samples . @param skipRowsFromStart skips this number of rows from start . @param asSparseMatrix returns sample set as sparse matrix ( SMatrix ) . @param inAs2D assumes two dimensional input such as image . @param inRows number of input rows . @param inCols number of input cols ( relevant for 2D input ) . @param outAs2D assumes two dimensional output such as image . @param outRows number of output rows . @param outCols number of output cols ( relevant for 2D output ) . @return structure containing input and output matrices . @throws FileNotFoundException throws exception if file is not found .
public static HashMap<Integer, HashMap<Integer, MMatrix>> readFile(String fileName, String separator, HashSet<Integer> inputColumns, HashSet<Integer> outputColumns, int skipRowsFromStart, boolean asSparseMatrix, boolean inAs2D, int inRows, int inCols, boolean outAs2D, int outRows, int outCols) throws FileNotFoundException {
        HashMap<Integer, Integer> inputColumnMap = new HashMap<>();
        HashMap<Integer, Integer> outputColumnMap = new HashMap<>();
        int index;
        index = 0;
        for (Integer pos : inputColumns) inputColumnMap.put(pos, index++);
        index = 0;
        for (Integer pos : outputColumns) outputColumnMap.put(pos, index++);
        inRows = inAs2D ? inRows : inputColumnMap.size();
        inCols = inAs2D ? inCols : 1;
        outRows = outAs2D ? outRows : outputColumnMap.size();
        outCols = outAs2D ? outCols : 1;
        File file = new File(fileName);
        Scanner scanner = new Scanner(file);
        int countSkipRows = 0;
        while (countSkipRows++ < skipRowsFromStart && scanner.hasNextLine()) scanner.nextLine();
        HashMap<Integer, MMatrix> inputData = new HashMap<>();
        HashMap<Integer, MMatrix> outputData = new HashMap<>();
        int row = 0;
        while (scanner.hasNextLine()) {
            String[] items = scanner.nextLine().split(separator);
            addItem(items, inputColumnMap, row, inAs2D, inRows, inCols, asSparseMatrix, inputData);
            addItem(items, outputColumnMap, row, outAs2D, outRows, outCols, asSparseMatrix, outputData);
            row++;
        }
        HashMap<Integer, HashMap<Integer, MMatrix>> result = new HashMap<>();
        result.put(0, inputData);
        result.put(1, outputData);
        return result;
    }
public static HashMap < Integer , HashMap < Integer , MMatrix > > readFile ( String fileName , String separator , HashSet < Integer > inputColumns , HashSet < Integer > outputColumns , int skipRowsFromStart , boolean asSparseMatrix , boolean inAs2D , int inRows , int inCols , boolean outAs2D , int outRows , int outCols ) throws FileNotFoundException { HashMap < Integer , Integer > inputColumnMap = new HashMap < > ( ) ; HashMap < Integer , Integer > outputColumnMap = new HashMap < > ( ) ; int index ; index = 0 ; for ( Integer pos : inputColumns ) inputColumnMap . put ( pos , index ++ ) ; index = 0 ; for ( Integer pos : outputColumns ) outputColumnMap . put ( pos , index ++ ) ; inRows = inAs2D ? inRows : inputColumnMap . size ( ) ; inCols = inAs2D ? inCols : 1 ; outRows = outAs2D ? outRows : outputColumnMap . size ( ) ; outCols = outAs2D ? outCols : 1 ; File file = new File ( fileName ) ; Scanner scanner = new Scanner ( file ) ; int countSkipRows = 0 ; while ( countSkipRows ++ < skipRowsFromStart && scanner . hasNextLine ( ) ) scanner . nextLine ( ) ; HashMap < Integer , MMatrix > inputData = new HashMap < > ( ) ; HashMap < Integer , MMatrix > outputData = new HashMap < > ( ) ; int row = 0 ; while ( scanner . hasNextLine ( ) ) { String [ ] items = scanner . nextLine ( ) . split ( separator ) ; addItem ( items , inputColumnMap , row , inAs2D , inRows , inCols , asSparseMatrix , inputData ) ; addItem ( items , outputColumnMap , row , outAs2D , outRows , outCols , asSparseMatrix , outputData ) ; row ++ ; } HashMap < Integer , HashMap < Integer , MMatrix > > result = new HashMap < > ( ) ; result . put ( 0 , inputData ) ; result . put ( 1 , outputData ) ; return result ; }
Reads CVS file and transforms comma separated data as input and output sample set.<br>
 Separates each value separated by separator to own column.<br>
 Returns input matrix with hash map index 0 and output matrix with hash map index 1.<br>
Reads CVS file and transforms comma separated data as input and output sample set . <br > Separates each value separated by separator to own column . <br > Returns input matrix with hash map index 0 and output matrix with hash map index 1 . <br >