smartcorelib / smartcore

A comprehensive library for machine learning and numerical computing. The library provides a set of tools for linear algebra, numerical computing, optimization, and enables a generic, powerful yet still efficient approach to machine learning.
https://smartcorelib.org/
Apache License 2.0
698 stars 75 forks source link

Fix #245: return error for NaN in naive bayes #246

Open Mec-iS opened 1 year ago

Mec-iS commented 1 year ago

Fix #245

Check if log_likehood is NaN and return an error as a Result. Add test as suggested.

Mec-iS commented 1 year ago

cc: @chriamue

codecov-commenter commented 1 year ago

Codecov Report

Merging #246 (f2f4068) into development (d15ea43) will increase coverage by 0.13%. The diff coverage is 63.63%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@               Coverage Diff               @@
##           development     #246      +/-   ##
===============================================
+ Coverage        44.50%   44.64%   +0.13%     
===============================================
  Files               85       85              
  Lines             7226     7235       +9     
===============================================
+ Hits              3216     3230      +14     
+ Misses            4010     4005       -5     
Impacted Files Coverage Δ
src/naive_bayes/gaussian.rs 36.45% <ø> (+1.04%) :arrow_up:
src/naive_bayes/mod.rs 44.11% <63.63%> (+12.11%) :arrow_up:

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.