Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Naive Bayes, avoid using Option::unwrap and so avoid panicking from NaN values #274

Merged

Conversation

corebreaker
Copy link
Contributor

Fixes #273

Checklist

  • My branch is up-to-date with development branch.
  • Everything works and tested on latest stable Rust.
  • Coverage and Linting have been applied

Current behaviour

Panics in function naive_bayes::BaseNaiveBayes::predict

New expected behaviour

No panics with NaNs

@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (9c07925) 45.04% compared to head (00fb486) 44.95%.

Files Patch % Lines
src/naive_bayes/mod.rs 35.71% 9 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #274      +/-   ##
===============================================
- Coverage        45.04%   44.95%   -0.10%     
===============================================
  Files               85       85              
  Lines             7206     7214       +8     
===============================================
- Hits              3246     3243       -3     
- Misses            3960     3971      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@morenol
Copy link
Collaborator

morenol commented Dec 31, 2023

Thanks @corebreaker, can you add an unit test for that?

@corebreaker
Copy link
Contributor Author

corebreaker commented Dec 31, 2023

Sure, @morenol, i'll add an unit test.

@corebreaker
Copy link
Contributor Author

@morenol , unit tests were added.

@corebreaker
Copy link
Contributor Author

Sorry i forgot, review process.

@corebreaker corebreaker closed this Jan 9, 2024
@corebreaker corebreaker reopened this Jan 9, 2024
Copy link
Collaborator

@morenol morenol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@morenol morenol merged commit 886b563 into smartcorelib:development Jan 10, 2024
12 checks passed
@corebreaker corebreaker deleted the i273-naives-bayes-panics branch January 11, 2024 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panics in NaiveBayes
3 participants