I'm using the Weka Java library to read in a CSV file and convert it to an ARFF file.
The problem is that the CSV file doesn't have a header row, only data. How do I assign attribute names after I bring in the CSV file? (all the columns would be string data types)
Here is the code I have so far:
CSVLoader loader = new CSVLoader();
loader.setSource(new File(CSVFilePath));
Instances data = loader.getDataSet();
ArffSaver saver = new ArffSaver();
saver.setInstances(data);
saver.setFile(new File(outputFilePath));
saver.writeBatch();
I tried looking through the Weka source code to figure this out but I couldn't make heads or tails of it :-(