Skip to content

Clustering, density estimation, and anomaly detection · Hierarchical clustering · UCL016 · Algorithm

DIANA divisive hierarchical clustering

Construct a hierarchy from the top down, starting with all observations together and repeatedly splitting a selected cluster.

Runs in CodeSplash Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

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.hierarchical. 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

Construct a hierarchy from the top down, starting with all observations together and repeatedly splitting a selected cluster. It offers a different search path from agglomerative merging when broad separation is the main exploratory question.

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

A divisive tree whose current largest-diameter cluster is split by a splinter heuristic.

Assumptions

The method is greedy: an early division constrains all later descendants. It does not optimize a globally optimal tree and does not supply a generative probability model. Large dissimilarity matrices limit scale.

Formula / computational definition

DIANA typically selects the cluster with largest diameter, seeds a splinter group using an observation with large average dissimilarity, and moves an observation ii when Δi=dˉ(i,remainder)−dˉ(i,splinter)>0\Delta_i=\bar d(i,\text{remainder})-\bar d(i,\text{splinter})>0. Average distances exclude the observation itself where appropriate.

Parameters and notation

Learned or fitted quantities: Recursive splits and final labels. User-set hyperparameters/design choices: Choose dissimilarity, optional standardization, and the eventual tree cut. 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

Compare coarse splits with agglomerative results, inspect the divisive coefficient and dendrogram, and assess resampling stability. Report which variables explain a split before naming its children.

Example application

Identify broad divisions in a dissimilarity-based taxonomy before finer splits. 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

R supplies cluster::diana. Python requires a custom splinter-group implementation or a bridge to R; recursively applying K-means produces a different divisive algorithm and should not be labeled DIANA.

Component: DIANA splinter preference for one candidate. 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.

Python

Component demo, not a trained model — DIANA splinter preference for one candidate. · needs numpy

import numpy as np
x=4.; remainder=np.array([0.,1.]); splinter=np.array([8.,9.])
result=np.abs(x-remainder).mean()-np.abs(x-splinter).mean()
print(result)
R

Component demo, not a trained model — DIANA splinter preference for one candidate.

x=4; remainder=c(0,1); splinter=c(8,9)
result=mean(abs(x-remainder))-mean(abs(x-splinter))
print(result)

Sources

From the CodeSplash reference, entry UCL016.