I need to normalize a CSV file. I followed this article written by Jeff Histon . These are (some) of my code:
File sourceFile = new File("Book1.csv"); File targetFile = new File("Book1_norm.csv"); EncogAnalyst analyst = new EncogAnalyst(); AnalystWizard wizard = new AnalystWizard(analyst); wizard.wizard(sourceFile, true, AnalystFileFormat.DECPNT_COMMA); final AnalystNormalizeCSV norm = new AnalystNormalizeCSV(); norm.analyze(sourceFile, false, CSVFormat.ENGLISH, analyst); norm.setProduceOutputHeaders(false); norm.normalize(targetFile);
The only difference between my code and one of the articles is the line:
norm.setOutputFormat(CSVFormat.ENGLISH);
I tried using it, but it does not seem to exist in Encog 3.1.0. The error I get is this (it seems the problem is with the norm.normalize(targetFile) :
Exception in thread "main" org.encog.app.analyst.AnalystError: Can't find column: 11700 at org.encog.app.analyst.util.CSVHeaders.find(CSVHeaders.java:187) at org.encog.app.analyst.csv.normalize.AnalystNormalizeCSV.extractFields(AnalystNormalizeCSV.java:77) at org.encog.app.analyst.csv.normalize.AnalystNormalizeCSV.normalize(AnalystNormalizeCSV.java:192) at IEinSoftware.main(IEinSoftware.java:55)
source share