Skip to content

Conversation

@Dcyaprogrammer
Copy link
Contributor

Pull Request Template

Description

Implementation of a classic classification algorithm in ML

Naive Bayes classifier for classification tasks.
This implementation uses Gaussian Naive Bayes, which assumes that features follow a normal (Gaussian) distribution.
The algorithm calculates class priors and feature statistics (mean and variance) for each class, then uses Bayes' theorem to predict class probabilities.

comprehensive tests run successfully.

Type of change

  • ✅ New feature (non-breaking change which adds functionality)

Checklist:

  • ✅ I ran bellow commands using the latest version of rust nightly.
  • ✅ I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • ✅ I ran cargo fmt just before my last commit.
  • ✅ I ran cargo test just before my last commit and all tests passed.
  • ✅ I added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • ✅ I added my algorithm to DIRECTORY.md with the correct link.
  • ✅ I checked COUNTRIBUTING.md and my code follows its guidelines.

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 98.47716% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.98%. Comparing base (5a4e21f) to head (cb1e2f9).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/machine_learning/naive_bayes.rs 98.47% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #997      +/-   ##
==========================================
+ Coverage   95.93%   95.98%   +0.05%     
==========================================
  Files         367      368       +1     
  Lines       25254    25451     +197     
==========================================
+ Hits        24227    24430     +203     
+ Misses       1027     1021       -6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dcyaprogrammer
Copy link
Contributor Author

Hi @siriak, would you please take a look to your convenience. I believe this is ready to be merged. Thank you! Lines missing coverage in the report are function's inside logic, hard to cover with test case. Normal and boundary cases have been tested.

@siriak siriak merged commit 39607d1 into TheAlgorithms:master Jan 16, 2026
7 checks passed
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.

3 participants