Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a constraints feature to the vsclust fuzzy c-means clustering algorithm, allowing users to fix certain membership values to zero. This enables excluding specific features from being assigned to particular clusters.
Key Changes:
- Added optional
constraintsparameter (logical matrix) to clustering functions that forces membership values to zero for constrained feature-cluster pairs - Updated C++ implementation with constraint-aware versions of distance and membership update functions
- Added comprehensive test coverage for constraint functionality
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vsclust_algo.cpp | Implements constraint logic in C++ fuzzy c-means algorithm with overloaded distance/membership functions |
| src/RcppExports.cpp | Updates exported C++ function signatures to include constraints parameter |
| R/RcppExports.R | Adds R wrapper handling for constraints with default empty matrix initialization |
| R/RunClustering.R | Adds constraints validation and integrates constraint parameter into clustering functions |
| R/WrapperFuncs.R | Propagates constraints parameter through wrapper functions and removes unnecessary clusterExport calls |
| tests/testthat/test-HelperFuncs.R | Adds test cases validating constraint behavior in both vsclust_algorithm and ClustComp |
| man/*.Rd | Updates documentation to describe constraints parameter and fixes existing typos |
| ..Rcheck/00check.log | Build log showing R version update (informational only) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.