Skip to content

Conversation

@Dcyaprogrammer
Copy link
Contributor

Pull Request Template

Description

Principal Component Analysis (PCA) is one of the most famous dimension reduction method. It is an unsupervised learning method. PCA transforms data to a new coordinate system where the greatest variance lies on the first coordinate (first principal component), the second greatest variance on the second coordinate, and so on.

Type of change

Please delete options that are not relevant.

-✅ 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 18, 2026

Codecov Report

❌ Patch coverage is 99.13043% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.03%. Comparing base (d246ca5) to head (0df25c7).

Files with missing lines Patch % Lines
...c/machine_learning/principal_component_analysis.rs 99.13% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #999      +/-   ##
==========================================
+ Coverage   96.01%   96.03%   +0.02%     
==========================================
  Files         369      370       +1     
  Lines       25557    25787     +230     
==========================================
+ Hits        24538    24765     +227     
- Misses       1019     1022       +3     

☔ 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 aa24550 into TheAlgorithms:master Jan 18, 2026
7 checks passed
@Dcyaprogrammer Dcyaprogrammer deleted the pca branch January 19, 2026 05:33
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