Example usage for weka.core.converters CSVLoader setOptions

List of usage examples for weka.core.converters CSVLoader setOptions

Introduction

In this page you can find the example usage for weka.core.converters CSVLoader setOptions.

Prototype

@Override
    public void setOptions(String[] options) throws Exception 

Source Link

Usage

From source file:reader.CSVReader.java

/**
 *read the CSV file//from w w  w.jav  a  2  s.  c  om
 * @param file_name Name of the file we want to open
 * @param loader Storage for the loaded file
 * @throws java.lang.Exception
 */
public static void readCSVFile(String file_name, CSVLoader loader) throws Exception {

    loader.setSource(new File(file_name));
    //select options for the CSVloader (-H: no attribute names given in the first line/ -N 1: first column is a nominal attribute)
    String[] options = new String[3];
    options[0] = "-H";
    options[1] = "-N";
    options[2] = "1";
    loader.setOptions(options);

}