Add K-Means & K-Medians clustering algorithm - #7552
Open
Ashish2343 wants to merge 1 commit into
Open
Conversation
Ashish2343
requested review from
DenizAltunkapan,
alxkm and
yanglbme
as code owners
August 3, 2026 12:45
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7552 +/- ##
============================================
+ Coverage 80.42% 80.51% +0.09%
- Complexity 7457 7507 +50
============================================
Files 815 816 +1
Lines 24055 24195 +140
Branches 4732 4763 +31
============================================
+ Hits 19346 19481 +135
- Misses 3945 3946 +1
- Partials 764 768 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
@Ashish2343, before a detailed review, the Clang formatter needs to be fixed. And few quick suggestions regarding code.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add K-Means and K-Medians clustering (
machinelearningpackage)Adds a new
machinelearningpackage withClustring, providing two centroid-based clustering algorithms that share one iterative core (assign → update → check convergence):Both support deterministic initial centers (for reproducible tests) or seeded random init. Includes input validation (empty dataset, invalid
k, ragged dimensions, mismatched center count) and a full JUnit 5 test suite (ClustringTest) covering both algorithms, edge cases (k=1,k=n), and an outlier-robustness comparison.Closes #7534