jeffheaton / encog-java-core

http://www.heatonresearch.com/encog
Other
743 stars 268 forks source link

Workbench: Empty countPer in .ega #142

Closed PetrToman closed 10 years ago

PetrToman commented 11 years ago

For some data, Workbench generates .ega file with empty countPer parameter:

[BALANCE:CONFIG]
balanceField=y
countPer=
sourceFile=FILE_RANDOMIZE
targetFile=FILE_BALANCE

which later causes an exception:

[ERROR][Thread-5]: java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:504)
    at java.lang.Integer.parseInt(Integer.java:527)
    at org.encog.app.analyst.script.prop.ScriptProperties.getPropertyInt(ScriptProperties.java:449)
    at org.encog.app.analyst.commands.CmdBalance.executeCommand(CmdBalance.java:81)
    at org.encog.app.analyst.EncogAnalyst.executeTask(EncogAnalyst.java:509)
    at org.encog.app.analyst.EncogAnalyst.executeTask(EncogAnalyst.java:536)
    at org.encog.workbench.tabs.analyst.AnalystProgressTab.run(AnalystProgressTab.java:347)
    at java.lang.Thread.run(Thread.java:724)

Steps to reproduce:

  1. Get data from http://dione.zcu.cz/~toman40/encog/data1a.zip
  2. Run "Analyst wizard" with "Target field" = "y", "CSV File Headers" = yes, Tasks/Balance = yes
  3. After .ega is generated, run "task-full" -> exception is thrown.
jeffheaton commented 10 years ago

Thanks. I added a better error for this. The balance function, at least the way I have it implemented, can only be used on a nominal (non-numeric) field.