私は Java の初心者で、既存の .csv ファイルを .arff ファイルに変換したいのですが、以下のコードを書きましたが、変換されずにエラーが発生しています。これらのエラーを解決するのを手伝ってくれて、どのようにプログラムするかを教えてください:
import weka.core.Instances;
import weka.core.converters.ArffSaver;
import weka.core.converters.CSVLoader;
import java.io.File;
import java.io.IOException;
public class meena {
/**
* takes 2 arguments:
* - CSV input file
* - ARFF output file
*/
public static void main(String[] args) throws IOException {
String args0="C:\\Documents and Settings\\CORI\\My Documents\\NetBeansProjects\\trainingset\\build\\classes\\svmlearn\\in.csv ";
String args1="C:\\Documents and Settings\\CORI\\My Documents\\NetBeansProjects\\trainingset\\build\\classes\\svmlearn\\output1.txt";
// load CSV
CSVLoader loader = new CSVLoader();
loader.setSource(new File(args0));
Instances data = loader.getDataSet();
// save ARFF
ArffSaver saver = new ArffSaver();
saver.setInstances(data);
saver.setFile(new File(args[1]));
saver.setDestination(new File(args[1]));
saver.writeBatch();
}
}
I am getting the below error:
---Registering Weka Editors---
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at meena.main(meena.java:26)
Java Result: 1
Please help me to convert .csv file into .arff file by suggesting me clearly how and where to pass the input