How do you evaluate the stability of an unsupervised model across random seeds or resampling?

Quick Overview

How to check whether the clusters, embeddings or components from an unsupervised model hold up when you change the random seed or resample the data. Tests which perturbations to apply, which agreement metrics handle label switching, and how stability should feed into model selection.

How do you evaluate the stability of an unsupervised model across random seeds or resampling?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How do you evaluate the stability of an unsupervised model across random seeds or resampling? For example, you have fit k-means, a Gaussian mixture or a UMAP embedding to a dataset and want to know whether the structure it found is real or an artifact of one particular run. ```hint What to perturb List every source of randomness in the pipeline (initialization, which rows get sampled, small changes to the data or hyperparameters) and re-fit under each one. ``` ```hint Comparing runs Cluster labels and embedding coordinates are arbitrary from one run to the next. Look for agreement measures that do not care about label permutations or rotations. ``` ### What a Strong Answer Covers - The perturbations to apply: seeds, bootstrap or subsample resampling, and small noise or hyperparameter changes. - Agreement metrics that handle label switching and arbitrary coordinates, for whole clusterings, individual clusters, embeddings and components. - How to compare runs that were fit on different subsamples of the rows. - How stability feeds into choosing hyperparameters such as the number of clusters, and what it cannot tell you on its own. ### Follow-up Questions - Why can k-means look very stable at k=2 even on data with no cluster structure, and how would you guard against picking it? - How would you assess the stability of a t-SNE or UMAP embedding, where the global layout changes from run to run? - Your clustering is stable across seeds but unstable across bootstrap samples. What does that tell you? - How many re-fits do you need before the stability estimate itself is trustworthy?

Overview: How to check whether the clusters, embeddings or components from an unsupervised model hold up when you change the random seed or resample the data. Tests which perturbations to apply, which agreement metrics handle label switching, and how stability should feed into model selection.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How do you evaluate the stability of an unsupervised model across random seeds or resampling?

For example, you have fit k-means, a Gaussian mixture or a UMAP embedding to a dataset and want to know whether the structure it found is real or an artifact of one particular run.

What a Strong Answer Covers Guidance

  • The perturbations to apply: seeds, bootstrap or subsample resampling, and small noise or hyperparameter changes.
  • Agreement metrics that handle label switching and arbitrary coordinates, for whole clusterings, individual clusters, embeddings and components.
  • How to compare runs that were fit on different subsamples of the rows.
  • How stability feeds into choosing hyperparameters such as the number of clusters, and what it cannot tell you on its own.

Follow-up Questions Guidance

  • Why can k-means look very stable at k=2 even on data with no cluster structure, and how would you guard against picking it?
  • How would you assess the stability of a t-SNE or UMAP embedding, where the global layout changes from run to run?
  • Your clustering is stable across seeds but unstable across bootstrap samples. What does that tell you?
  • How many re-fits do you need before the stability estimate itself is trustworthy?