jhlee-visionkalman / accord

Automatically exported from code.google.com/p/accord
0 stars 0 forks source link

NaN as best error rate in GridSearchResult #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new GridSearch object with 2*2 parameters
2. Specify a Fitting function throwing a ConvergenceException once. Other calls 
return a normal double value e.g [0.2, 0.5, 0.1]
3. Call Compute() on the GridSearch object

What is the expected output? What do you see instead?
As the best error rate in the received GridSearchResult 0.1 is expected. 
Instead, the Error property of the result is set to double.NaN

What version of the product are you using? On what operating system?
Accord 2.2.8

Please provide any additional information below.

double.NaN is set as error rate if a ConvergenceException is thrown while 
computing the Fitting function. This error rate is added to the errors array. 
At the end, the best error rate is estimated by the Min function of the System 
Library. If a value in the error array is set to double.NaN, this rate is 
selected as the Min value

 var doubles = new[] {0.5, double.NaN, 1.0, 3.0};
 Console.WriteLine(doubles.Min()); 
 //writes "n. Def"

Original issue reported on code.google.com by Mail.Hau...@gmail.com on 23 May 2013 at 11:16

GoogleCodeExporter commented 9 years ago
Thanks for reporting!

Original comment by cesarso...@gmail.com on 23 May 2013 at 2:00

GoogleCodeExporter commented 9 years ago
A fix will be available in the next framework release.

Original comment by cesarso...@gmail.com on 1 Jun 2013 at 4:47

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r553.

Original comment by cesarso...@gmail.com on 1 Jun 2013 at 10:28