jeffheaton / encog-java-core

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

Workbench: SOM - ArrayIndexOutOfBoundsException #79

Closed PetrToman closed 12 years ago

PetrToman commented 12 years ago

Run Analyst on data1.csv (http://dione.zcu.cz/~toman40/encog/data1.zip) and choose "Self Organizing Map (SOM)". The following exception will be thrown:

Exception: java.lang.ArrayIndexOutOfBoundsException: 0
org.encog.mathutil.matrices.Matrix.getCols(Matrix.java:307)
org.encog.persist.EncogWriteHelper.writeProperty(EncogWriteHelper.java:348)
org.encog.neural.som.PersistSOM.save(PersistSOM.java:94)
org.encog.persist.EncogDirectoryPersistence.saveObject(EncogDirectoryPersistence.java:206)
org.encog.persist.EncogDirectoryPersistence.saveObject(EncogDirectoryPersistence.java:170)
org.encog.app.analyst.commands.CmdCreate.executeCommand(CmdCreate.java:102)
org.encog.app.analyst.EncogAnalyst.executeTask(EncogAnalyst.java:487)
org.encog.app.analyst.EncogAnalyst.executeTask(EncogAnalyst.java:514)
org.encog.workbench.tabs.analyst.AnalystProgressTab.run(AnalystProgressTab.java:334)
java.lang.Thread.run(Unknown Source)
jeffheaton commented 12 years ago

The wizard was assigning zero output neurons, which translates to zero classes for a SOM, which won't work. Fixed this issue by assigning the number of output neurons to be the number of choices on the target field.