Skip to content

Evaluation, diagnostics, benchmarks, and additional tests · Evaluation, diagnostics, benchmarks, and additional hypothesis tests · EVA009 · Diagnostic

Bootstrap cluster stability with Jaccard matching

Measures how often each discovered cluster is recovered under resampling or perturbation.

Runs in CodeSplash Complete calculation 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
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through discover.stability. 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

Measures how often each discovered cluster is recovered under resampling or perturbation.

Question / hypotheses

Does this particular group persist when the empirical sample changes?

Architecture / computational structure

A fixed scoring/calibration pipeline applied to model outputs or supplied observations; the formula and usage sections identify its operations.

Assumptions

Resampling must respect the sampling unit and map resampled observations back to original identities. Compare only appropriately eligible identities; define treatment of duplicate bootstrap observations and noise.

Formula / computational definition

J(C,Cb∗)=∣C∩Cb∗∣∣C∪Cb∗∣,SC=B−1∑bmax⁡jJ(C,Cbj∗).J(C,C_b^*)=\frac{|C\cap C_b^*|}{|C\cup C_b^*|},\qquad S_C=B^{-1}\sum_b\max_j J(C,C_{bj}^{*}).

Parameters and notation

C is a reference cluster; B is number of resamples. Resampling scheme, matching, distance, and clustering hyperparameters define what stability means.

Fitting, fine-tuning, and adaptation

There is no model fine-tuning step for this evaluation procedure. Freeze the evaluated systems and evaluator before the final test. Select evaluation settings on development data; if a learned evaluator or calibration model is adapted, use separate fitting data, version it, and reassess its validity.

How to use and calibrate

Refit the entire preprocessing-and-clustering pipeline within each resample. Match each original cluster to its closest resampled counterpart and plot stability by cluster size.

Example application

Identify a fragile rare subgroup that disappears after small changes to the dataset.

Interpretation / pitfalls

Watch out

Stability is not correctness. Very rigid methods can be stably wrong; jitter, bootstrap, and subsampling examine different robustness questions.

Python and R code examples

Scope: Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

Validation: Python — Executed successfully on synthetic inputs. R — reviewed but not executed in this environment. Python dependencies are explicit imports; R uses base R unless a package/bridge is explicitly named.

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

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

C={0,1,2,3}; candidates=[{0,1,2},{3,4,5}]
print(max(len(C&D)/len(C|D) for D in candidates))
R

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

C <- c(0,1,2,3); candidates <- list(c(0,1,2),c(3,4,5))
print(max(vapply(candidates,function(D) length(intersect(C,D))/length(union(C,D)),0.0)))

Sources

From the CodeSplash reference, entry EVA009.