Clustering, density estimation, and anomaly detection · Density and exemplar clustering · UCL024 · Algorithm
DENCLUE
Define clusters through attractors of a smooth estimated density and merge attractors connected through sufficiently dense regions.
In CodeSplash
A CodeSplash method runs this entry in Python and R. Set it up from the method's page.
- Mean shift Verified in Python and R
Do it in CodeSplash Run it on your own data, in Python or R.
- Availability
- Runs in CodeSplash
- Code example
- Component demo, not a trained model
- Who ran it
- CodeSplash's run and the reference's record
- CodeSplash's run
- Verified in Python and R through discover.meanshift. 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
Define clusters through attractors of a smooth estimated density and merge attractors connected through sufficiently dense regions. This creates a density-model interpretation of clusters and explicit low-density noise handling.
Question / hypotheses
Which dense groups, modes, or exemplars persist under a defensible similarity scale? This entry defines an estimation or optimization objective, not an intrinsic null/alternative hypothesis test.
Architecture / computational structure
Kernel influence sums, gradient mode search, and density-connected attractor merging.
Assumptions
Density estimation deteriorates with dimension; coordinate scaling directly affects the density landscape. Small bandwidths fragment clusters, while large bandwidths erase modes. DENCLUE and mean shift share mode-seeking ideas but are not identical clustering specifications.
Formula / computational definition
Estimate , often with Gaussian influence, and move points toward density attractors using the gradient. Attractors below threshold are excluded; density-connected attractors define groups. Bandwidth determines smoothing, and sets the accepted density level.
Parameters and notation
Learned or fitted quantities: Density attractors, associations to them, and noise labels. User-set hyperparameters/design choices: Choose bandwidth, density threshold, numerical convergence, and acceleration 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. Refit or rebuild neighborhoods when the reference distribution changes. Recalibrate neighborhood and extraction settings using stable density structure; verify whether the implementation supports genuine new-point assignment before deployment.
How to use and calibrate
Plot estimated density and attractors in interpretable dimensions, examine merge sensitivity, and report noise coverage. Check convergence of ascent trajectories and robustness to bandwidth.
Example application
Locate modes of a smoothed spatial population and reject low-density attractors. 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
A custom implementation can combine KDE gradients, mode convergence, and threshold-connected merging in both languages. The component example evaluates Gaussian density and its ascent direction, not the full original indexing and merging procedure.
Component: Gaussian KDE density and gradient for DENCLUE. 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 — Gaussian KDE density and gradient for DENCLUE. · needs numpy
import numpy as np
x=np.array([-1.,0.,1.]); q=.3; h=.7
w=np.exp(-.5*((q-x)/h)**2)/(np.sqrt(2*np.pi)*h)
result=np.array([w.mean(),np.mean(w*(x-q)/h**2)])
print(result)
Component demo, not a trained model — Gaussian KDE density and gradient for DENCLUE.
x=c(-1,0,1); q=.3; h=.7; w=dnorm((q-x)/h)/h
result=c(density=mean(w),gradient=mean(w*(x-q)/h^2))
print(result)
Sources
- Source 1scispace.com
From the CodeSplash reference, entry UCL024.