jeffheaton / encog-java-core

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

EncogModel.selectMethod() sibling fails to set this.config #189

Open andrewthomas28 opened 9 years ago

andrewthomas28 commented 9 years ago

This is using Encog 3.3.0 for Java.

The class EncogModel has two selectMethod() methods. The one with more arguments appears to omit a field assignment relied on by subsequent EncogModel methods.

This two-argument method sets member field this.config. public void selectMethod(VersatileMLDataSet dataset, String methodType) {

This sibling with more arguments does NOT set this.config. public void selectMethod(VersatileMLDataSet dataset, String methodType, String methodArgs, String trainingType, String trainingArgs) {

A subsequent call to EncogModel.createMethod() presumes that this.config has been set.

Exception in thread "main" java.lang.NullPointerException at org.encog.ml.model.EncogModel.createMethod(EncogModel.java:366) at org.encog.ml.model.EncogModel.fitFold(EncogModel.java:190) at org.encog.ml.model.EncogModel.crossvalidate(EncogModel.java:285) ...

(Also, the sibling with more arguments ignores its last two arguments - trainingType and trainingArgs.)