Clustering, density estimation, and anomaly detection · Hierarchical clustering · UCL018 · Algorithm
CURE
Represent each cluster with several well-scattered points shrunk toward its centroid, allowing hierarchical clustering to capture shapes more flexibly than one centroid while reducing influence of extreme…
In CodeSplash
Documented in the Academy only. There's no Set up button.
- Availability
- Explained here
- Code example
- Component demo, not a trained model
- Who ran it
- CodeSplash's run and the reference's record
- CodeSplash's run
- The reference's example ran in Python and R here, and they agree.
- The reference's record
- Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.
Purpose
Represent each cluster with several well-scattered points shrunk toward its centroid, allowing hierarchical clustering to capture shapes more flexibly than one centroid while reducing influence of extreme representatives.
Question / hypotheses
Which nested divisions or merges summarize the specified dissimilarity structure? This entry defines an estimation or optimization objective, not an intrinsic null/alternative hypothesis test.
Architecture / computational structure
An agglomerative hierarchy storing multiple shrunk representatives per cluster.
Assumptions
The original scalable algorithm uses sampling and intermediate clustering. Results can miss small groups if sampling is inadequate; the distance still depends on meaningful Euclidean coordinates. Shrinkage does not guarantee robustness to all contamination patterns.
Formula / computational definition
Choose representative points and shrink them to . Distance between clusters is the minimum distance between their shrunk representatives. Here is representative count and is shrinkage.
Parameters and notation
Learned or fitted quantities: Representative points, centroids, merge structure, and labels. User-set hyperparameters/design choices: Specify final , , shrinkage, sampling size, and partitioning strategy. Tune these against the stated objective and stability/validation criteria; do not select settings on the final evaluation set.
Fitting, fine-tuning, and adaptation
Neural fine-tuning is not applicable. A changed distance or linkage generally requires rebuilding the hierarchy. A cut can be changed without rebuilding the tree; assigning new cases to a fixed tree needs a separately stated rule and is not identical to refitting.
How to use and calibrate
Examine representative coverage, recovery of nonspherical groups, sampling stability, and runtime. Compare full-data labels rather than only representatives in a visualization.
Example application
Group spatial populations with different shapes using several representatives. Define the reference population, measurement units, and success criterion before fitting; investigate whether discovered groups or alerts reflect the intended phenomenon.
Interpretation / pitfalls
Watch out
The reported result is conditional on the representation and objective. A stable partition can reflect nuisance structure such as batch, collection site, or missingness. Confirm the interpretation in original variables and an independent sample.
Python and R code examples
The pyclustering project documents CURE. R requires a custom implementation or Python bridge. A teaching example that only shrinks representatives should be labeled a CURE component; actual fitting also needs farthest-point selection, merge updates, and stopping logic.
Component: CURE representative shrinkage. Python: executed successfully; R: not executed (Rscript unavailable). These small fixtures establish the arithmetic operation, not full-method accuracy or reproduction of paper results.
Python and R
The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.
Component demo, not a trained model — CURE representative shrinkage. · needs numpy
import numpy as np
reps=np.array([[0.,0.],[4.,2.]]); center=np.array([2.,1.]); alpha=.3
result=(1-alpha)*reps+alpha*center
print(result)
Component demo, not a trained model — CURE representative shrinkage.
reps=rbind(c(0,0),c(4,2)); center=c(2,1); alpha=.3
result=sweep((1-alpha)*reps,2,alpha*center,'+')
print(result)
Sources
- Source 1sigmodrecord.org
- Source 2pyclustering.github.io
From the CodeSplash reference, entry UCL018.