jeffheaton / encog-dotnet-core

http://www.heatonresearch.com/encog
Other
429 stars 149 forks source link

TYPE_PNN fails for tutorial examples #96

Open TisVeugen opened 8 years ago

TisVeugen commented 8 years ago

The 3 tutorial examples in Encog 3.3: Quick Start Guide (IrisClassification, AutoMPGRegression, SunSpotTimeseries) have a comment that method MLMethodFactor.TYPE_PNN (i.e. Probabilistic Neural Network) can be used. However, changing the source code to this method results in an exception:

java.lang.NullPointerException at org.encog.neural.pnn.BasicPNN.setSamples(BasicPNN.java:236) at org.encog.neural.networks.training.pnn.TrainBasicPNN.iteration(TrainBasicPNN.java:599) at org.encog.ml.model.EncogModel.fitFold(EncogModel.java:218) at org.encog.ml.model.EncogModel.crossvalidate(EncogModel.java:285) at org.encog.examples.guide.classification.IrisClassification.run(IrisClassification.java:118) at org.encog.examples.guide.classification.IrisClassification.main(IrisClassification.java:176)

This exception refers to the MLData ideal that is still null for each (MLDataPair) pair

.Please, can this problem be fixed?

jeroldhaas commented 8 years ago

The exceptions you posted appear to be java exceptions, not .NET exceptions.

Your issue should likely be posted at encog-java-core instead of this repository, as this repository is specific to the Encog core for .NET.

jeroldhaas commented 8 years ago

@TisVeugen using "Peek Definition" in Visual Studio, you'll see that TYPE_PNN has been renamed to TypePNN in the MLMethodFactory.

Also of note is that all the others have been refactored to have the more C#-idiomatic nomenclature (such as TypeSVM, TypeSOM, and TypeRbfnetwork).

Since I don't work with Java, I cannot make any claims as to how the ML Factory declares its types in Java.

ghost commented 7 years ago

Hi, I am still getting this error. When I use the PNN type, on the SunSpotTimeseries example, I get a System.NullReferenceException on line 121 of BasicPNN.cs; I am using the latest 3.3 .NET release.

Is there a known fix or workaround?

Thanks! James