Skip to content

SLINK: Single-link agglomerative clusterer - #525

Open
andrewdalpino wants to merge 5 commits into
3.4from
slink
Open

andrewdalpino wants to merge 5 commits into
3.4from
slink

Conversation

@andrewdalpino

@andrewdalpino andrewdalpino commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

No description provided.

@andrewdalpino
andrewdalpino requested review from a team and a balanced review from Copilot October 21, 2026 00:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Recovered cluster memberships are lost, NaN distances bypass detection, and probability normalization adds avoidable quadratic work per sample.

3 open issues
What changed in this PR

Adds SLINK single-link agglomerative clustering to Rubix ML.

Changes:

  • Implements distance-limited clustering, medoid-based prediction, probabilities, and progress reporting.
  • Adds tests and a training/prediction benchmark.
  • Documents SLINK and adds it to estimator listings and navigation.
File Description
tests/​Clusterers/​SLINKTest.php Tests clustering, prediction, validation, and persistence.
src/​Clusterers/​SLINK.php Implements the SLINK estimator.
mkdocs.yml Adds SLINK navigation.
docs/​clusterers/​slink.md Documents behavior and public methods.
docs/​choosing-an-estimator.md Lists SLINK among clusterers.
benchmarks/​Clusterers/​SLINKBench.php Benchmarks training and prediction.

Review effort: Balanced

Comment thread src/Clusterers/SLINK.php Outdated
$lambda[$i] = INF;

for ($j = 0; $j < $i; ++$j) {
$mu[$j] = $this->kernel->compute($samples[$j], $samples[$i]);
Comment thread src/Clusterers/SLINK.php Outdated
*/
public function predictSample(array $sample) : int
{
return argmin($this->medoidDistances($sample));
Comment thread src/Clusterers/SLINK.php Outdated
Comment on lines +464 to +472
foreach ($distances as $distanceA) {
$sigma = 0.0;

foreach ($distances as $distanceB) {
$sigma += $distanceA / $distanceB;
}

$proba[] = 1.0 / $sigma;
}

This branch has not been deployed

No deployments
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.

2 participants