Skip to content

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

Prediction strength

Checks whether clusters learned on one subset predict co-membership in an independently clustered subset.

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

Checks whether clusters learned on one subset predict co-membership in an independently clustered subset.

Question / hypotheses

How reproducibly does a candidate number of groups generalize under a specified assignment rule?

Architecture / computational structure

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

Assumptions

A meaningful out-of-sample assignment rule is required. Splits must respect subjects, time, or other dependence. Tiny validation clusters make pair counts unstable.

Formula / computational definition

PS(k)=min⁡j∑i≠i′∈Cj1{c^i=c^i′}∣Cj∣(∣Cj∣−1).PS(k)=\min_j\frac{\sum_{i\ne i'\in C_j}\mathbf1\{\hat c_i=\hat c_{i'}\}}{|C_j|(|C_j|-1)}.

Parameters and notation

C_j are validation clusters; predicted labels come from training clusters. k, split fractions, repetitions, and the desired stability threshold are analysis hyperparameters.

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

Repeat train/validation splits, fit both partitions, assign validation observations with the training model, and aggregate the minimum co-membership agreement. Plot the distribution rather than treating a conventional cutoff as a significance threshold.

Example application

Assess which customer segmentation resolutions remain reproducible on new customers.

Interpretation / pitfalls

Watch out

A stable coarse partition may hide useful subgroups; a stable artifact remains an artifact. Training and validation cluster numbers must follow the intended protocol.

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. · needs numpy

import numpy as np
pred=np.array([0,0,0,1]); same=(pred[:,None]==pred[None,:])
print((same.sum()-len(pred))/(len(pred)*(len(pred)-1)))
R

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

pred <- c(0,0,0,1); same <- outer(pred,pred,"==")
print((sum(same)-length(pred))/(length(pred)*(length(pred)-1)))

Sources

From the CodeSplash reference, entry EVA008.