You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'classifier::bayes::tests::test_detector' panicked at 'called `Option::unwrap()` on a `None` value', /Users/chriamue/.cargo/registry/src/github.com-1ecc6299db9ec823/smartcore-0.3.0/src/naive_bayes/mod.rs:109:67
I'm submitting a
Current Behaviour:
Prediction of GaussianNB fails when trained on very small data.
Expected Behaviour:
Assertion of Y may fail but should not panic.
Steps to reproduce:
Snapshot:
https://github.com/smartcorelib/smartcore/blob/development/src/naive_bayes/mod.rs#L109
p1 or p2 is NaN so partial_cmp is None which panics on unwrap().
Do you want to work on this issue?
A solution would be to check the log_likelihood for NaN and return 0, but I am not sure if this is mathematically right.
https://github.com/smartcorelib/smartcore/blob/development/src/naive_bayes/gaussian.rs#L77
Another solution is to check for NaN in predict function:
https://github.com/smartcorelib/smartcore/blob/development/src/naive_bayes/mod.rs#L102
The text was updated successfully, but these errors were encountered: