sethjuarez / numl

Machine Learning for .NET
http://numl.net
MIT License
430 stars 104 forks source link

Score accuracy was always 0 #78

Closed rold2007 closed 7 years ago

rold2007 commented 7 years ago

While doing some tests with NaiveBayes models I noticed that the Accuracy was always 0 using the Iris data set. A cast was actually missing.

I also added a basic check of the accuracy in the tests. I hardcoded a minimal accuracy of 0.75 but maybe it would be better for each test to choose its own accuracy. Note that once in a while Tennis_Learner_Tests will fail because its accuracy is 0.66. Lowering the minimal accuracy in this case will not help because in that case anyways the next assert (Assert.True(test(prediction));) will also fail. Maybe the trainingPercentage should be increased ?

Also note that in Linear_Regression_Learner_Test the accuracy check seems wrong. I think it should be

Assert.True(model.Accuracy >= 0.8);

instead of

Assert.True(0.8 >= model.Accuracy);

I didn't want to include this change in this pull request as the way the accuracy is computed doesn't make sense for linear regression anyways. The accuracy is 0.0 for this test... Should I open an issue for this ?

rold2007 commented 7 years ago

@sethjuarez I'm sorry to push you on this but I sent this pull request almost 3 weeks ago and there hasn't been any update since. I can see that appveyor says that the build failed but I don't have access to your appveyor build details and I see that the dev branch started failing on Aug 31th after one of your commit. It does build without any error locally though.

sethjuarez commented 7 years ago

Sorry about that - I'm still trying to set up CI for pull requests. I will take a look at this sometime today/tomorrow. My apologies.

sethjuarez commented 7 years ago

Thanks for this. I will create a new nuget package.

sethjuarez commented 7 years ago

nuget package 0.9.20-beta should be up and ready!