Score-SG Background
algorithm="score-sg" is the approximate Core-SG construction path. It is
intended for experiments where dense all-pairs distance construction is too
expensive or where the anti-hub reinforced support graph is part of the method
being evaluated.
This makes Score-SG the scalable option when the traditional exact CoreSG path
is limited by n_samples. Exact CoreSG remains valuable for reference-style
construction, but its dense pairwise matrix becomes increasingly restrictive as
sample size grows.
What Changes Compared With The Default Path
The default algorithm="core-sg" path builds exact pairwise distance
information before constructing reusable support. Score-SG avoids that dense
all-pairs stage. Instead, it uses PyNNDescent to choose approximate neighbors
and then computes exact distances only for selected support edges.
This means Score-SG changes graph construction, not the public estimator workflow. Users still call:
clusterer = CoreSGClusterer(k_max=30, algorithm="score-sg")
clusterer.fit(X, k=20)
Approximate Neighbor Graph
PyNNDescent proposes the neighbor graph. Those neighbors define which local edges are eligible for the support graph. Because this step is approximate, two choices matter more than in the default path:
random_statefor reproducible tie handling;approx_knn_kwargsfor PyNNDescent tuning.
Anti-Hub Reinforcement
Score-SG counts how often each point appears in directed neighbor lists. Points with low directed in-degree are anti-hub candidates: they are rarely chosen as neighbors by other points. The implementation selects anti-hubs, connects them with exact-distance clique edges, and merges those edges into the support graph.
Why this matters: the anti-hub edges are intended to strengthen sparse support in regions that approximate neighbor search may underrepresent.