Unsupervised learning
Production Assignment, Drift, and the Cluster Lifecycle
Deploy cluster assignment with unknown handling, versioning, monitoring, drift analysis, and lifecycle governance.
By the end you can
- Choose an assignment strategy for new observations under centroid, density, hierarchical, or soft models
- Define rejection and unknown-regime behavior instead of forcing every input into an old group
- Monitor population, profile, boundary, and action drift across cluster versions
- Design a cluster lifecycle covering launch, refresh, migration, and retirement
Example
Production failures hidden by stable assignment rates
Operational monitoring must inspect profiles and consequences, not only label counts. None of the failures below shows up as a change in the number of rows per cluster. At least one of them already has a name. A 2021 systematic mapping study of AI-based systems read 21 primary studies and catalogued 72 antipatterns with 46 proposed solutions. The list a team monitors against does not have to be invented from scratch.
- Forced match: A novel product category is assigned to the nearest legacy segment despite a distance far outside training support. Nearest is a ranking, not a certificate of membership.
- Label migration: Cluster 2 in a new fit overlaps mostly with old Cluster 4, breaking dashboards that assumed numeric ID continuity.
- Action drift: A promotion tailored to one segment changes member behavior and erodes the profile that justified the action.
- Source shift: A new acquisition channel changes missingness and feature distributions, creating apparent segment growth.
- Silent consumer: An old batch report continues using retired cluster names after the assignment service has migrated. D. Sculley and nine Google co-authors named this failure in 2015: the undeclared consumers antipattern. The 2021 mapping study found it reported across three of its 21 primary studies, and states the cost plainly: “These undeclared or silent consumers constitute hidden coupling, which can have negative and obscure side effects during software evolution.”
Comparison
Ways to assign a new observation
The assignment mechanism has to match the fitted model and come with a rejection policy. Whether a fitted clustering can assign a new observation at all is not a design choice. It is a documented property of the algorithm. scikit-learn's user guide classifies K-Means, mean shift, affinity propagation, Gaussian mixtures, BIRCH and bisecting K-Means as inductive, and spectral clustering, Ward, agglomerative clustering, DBSCAN, HDBSCAN and OPTICS as transductive. The consequence is stated in one line: “Transductive clustering methods (in contrast to inductive clustering methods) are not designed to be applied to new, unseen data.” That sentence is why the surrogate-classifier column exists at all.
Where a library does offer prediction for a transductive method, it says what it is doing rather than pretending the limitation is gone. The hdbscan documentation describes HDBSCAN* as transductive and supplies approximate_predict. That function holds the existing clustering fixed. It returns a label — including -1 for noise — with a prediction strength for each new point. Nothing is re-fitted. The new observation is scored against a frozen structure, and it is allowed to come back as noise. That is the contract a production assignment service has to state explicitly, whichever of the four mechanisms below it is built on.
Nearest representative
Assign to the closest centroid or medoid.
- Fast and transparent
- Works for partition models
- Can force distant points into a group
- Needs a distance rejection threshold
Probabilistic responsibility
Use posterior component weights from a mixture model.
- Represents overlap
- Depends on distributional fit
- Supports entropy-based uncertainty
- Is not automatically calibrated to domain classes
Density membership
Use fitted density structure or approximate prediction.
- Can retain noise or unknown status
- May be implementation-specific
- Sensitive to reference density
- Needs drift handling
Surrogate classifier
Train a supervised model to reproduce cluster labels.
- Supports fast serving
- Approximates a fixed clustering version
- Can smooth boundaries
- Must be checked against original assignments
A live model that overstated flu in 100 of 108 weeks
Google Flu Trends went on producing estimates long after they stopped being right, and the count is on the record. A 2014 paper in Science set the published estimates against the surveillance data and recorded the run: “From 21 August 2011 to 1 September 2013, GFT reported overly high flu prevalence 100 out of 108 weeks.” In the 2011–2012 season the model overshot by more than 50%. The output stream itself announced nothing. A number arrived every week, on schedule, in the shape it had always had. The system was in the end retired rather than repaired: on 20 August 2015 Google announced it would stop maintaining the Flu Trends site, handing the raw signal to CDC, Columbia and Boston Children's Hospital instead.
A clustering deployment fails the same way. Production assignment is not exploratory clustering with a scheduler attached. A deployed system needs rules for unknowns, version changes, historical labels, and the actions tied to each group. It also needs a way of noticing when the labels have stopped describing anything. A steady label stream is exactly what a stale model produces.
A cluster model can remain numerically stable while becoming operationally obsolete.
Case
Temporal degradation in 91% of 128 model-and-dataset pairs
Accuracy can decay with nothing but the passage of time, and a 2022 paper in Scientific Reports measured how often. Its authors ran four standard models against 32 datasets drawn from healthcare operations, transportation, finance and weather — “all 4 × 32 = 128 (model, dataset) pairs” — and tracked error as each model aged past its training window. They “observed temporal model degradation in 91% of cases”. Leaving a fitted model alone is a decision with a measurable cost. 91% is the rate at which that cost is actually incurred.
Key idea
Do not compare cluster IDs across versions as if they were identities
Refitting can permute labels, split one group, merge several groups, or create a new unknown region. A numeric ID has no continuity unless an explicit alignment process establishes it.
The measure this warning is really asking for was published in 1985. Lawrence Hubert and Phipps Arabie opened their abstract by noting that “The problem of comparing two different partitions of a finite set of objects reappears continually in the clustering literature.” Their answer was to correct the Rand index for chance. The resulting adjusted Rand index ships in scikit-learn as adjusted_rand_score, citing Hubert and Arabie 1985. Its defining property is the one that matters here: the user guide demonstrates that “one can permute 0 and 1 in the predicted labels, rename 2 to 3, and get the same score”. A measure that is unchanged by renaming is telling you that the names carry no information. That is precisely why an ID-to-ID comparison across two fits is not a comparison at all.
So use overlap matrices, representative profiles, assignment costs, a chance-corrected agreement score, and downstream meaning to map versions. Preserve unmatched and ambiguous relationships rather than forcing one-to-one lineage. Software versioning solved a smaller version of the same problem by announcing it. Semantic Versioning 2.0.0 reserves the first number for breakage, incrementing the “MAJOR version when you make incompatible API changes”. A refit that splits or merges groups is exactly such a change. Cluster releases deserve the same public signal.
Cluster lineage can include split, merge, birth, drift, and death.
Analogy
Maintaining a transit zoning map through city growth
Fares and service planning in one city both run on the same zone map. New neighborhoods appear and travel patterns change. Old zone numbers cannot be reassigned casually because contracts and reports depend on them.
Statistical zones can move when preprocessing or sampling changes, even if the physical fleet does not. A taxonomy can be redrawn overnight by a rescaling nobody announced, and the zone numbers on last year's contracts will still print.
Changing the map requires migrating every system that uses its zones.
Steps
Operationalize a cluster model safely
Treat assignment, rejection, consumer migration, and monitoring as one system design: freeze the artifact set, define unknown behavior, instrument every assignment, monitor several drifts at once, compare candidate refreshes against the incumbent with a rollback prepared, and retire deliberately.
Step 4 is not this lesson's private recommendation. On 27 October 2021 the FDA, Health Canada and the MHRA jointly issued ten guiding principles for good machine learning practice in medical device development. Number 10 is titled “Deployed Models Are Monitored for Performance and Re-training Risks Are Managed”. It names dataset drift explicitly among the degradation risks that require controls once a model is retrained after deployment. Three regulators put their names to a numbered principle that treats monitoring and retraining risk as a single subject. That is the argument for tracking label mix, feature profiles, boundary margins, unknown rate and action performance together, rather than watching the first of the five and calling it observability.
1. Freeze the artifact set
Version data contract, preprocessing, model, profiles, thresholds, and interpretation.
2. Define unknown behavior
Set distance, density, responsibility, or support rules for abstention.
3. Instrument assignments
Log version, uncertainty, features, consumer action, and delayed outcomes.
4. Monitor several drifts
Track label mix, feature profiles, boundary margins, unknown rate, and action performance.
5. Compare candidate refreshes
Align old and new clusters, test consumers, and prepare rollback.
6. Retire deliberately
Remove stale names, jobs, routes, permissions, and reports while preserving evidence.
Visual
The lifecycle of a production cluster version
Somebody has to govern a cluster from the day its evidence is gathered to the day it is retired: design, launch, operate, refresh, migrate, retire.
The last stage is the one treated as paperwork, and Zillow paid for it in public. On 2 November 2021 the company announced it was winding down Zillow Offers because its home-price model could no longer be trusted. The Q3 2021 results release disclosed a write-down of inventory of approximately $304 million in the Homes segment and a further $240–265 million of expected Q4 losses. The wind-down cut roughly 25% of a workforce of more than 6,400. The quarter shows what an automated valuation running past its evidence does to the operation built on top of it: 9,680 homes bought, 3,032 sold. Zillow Group's co-founder and CEO, Rich Barton, gave the reason in the release itself — “We've determined the unpredictability in forecasting home prices far exceeds what we anticipated and continuing to scale Zillow Offers would result in too much earnings and balance-sheet volatility”. Retirement was not a cleanup task at the end of a checklist. It was the decision, and it arrived with a balance sheet.
Design
Define unit, representation, algorithm, validation, and intended actions.
Launch
Freeze preprocessing, assignment logic, thresholds, and cluster profiles.
Operate
Assign new data, handle unknowns, and monitor profile and action outcomes.
Refresh
Refit or revise when evidence shows drift, new regimes, or changed purpose.
Migrate
Map old and new memberships, update consumers, and preserve historical meaning.
Retire
Disable assignment, archive evidence, and remove obsolete actions and labels.
A label is meaningful only within the cluster version that created it.
Production clusters are changing interfaces
Cluster labels end up inside APIs, dashboards, decisions, and user experiences. That makes versioning and migration as important as the clustering algorithm. The system should admit novel observations and expose uncertain assignments. It should retire obsolete groups. Stable label counts alone are not evidence that the structure remains useful.
For one class of system this has stopped being advice. The EU's Artificial Intelligence Act, adopted in 2024, makes monitoring a duty of the provider. Article 72(1) states that “Providers shall establish and document a post-market monitoring system in a manner that is proportionate to the nature of the AI technologies and the risks of the high-risk AI system.” Article 72(2) requires that system to collect and analyse performance data “throughout their lifetime”, and the monitoring plan itself forms part of the technical documentation under Annex IV. The obligation runs for as long as the system is in use, not until launch. A team that cannot say which cluster version produced a label, what it was used for, or how the population under it has moved does not have a documentation gap. In that jurisdiction, for that class of system, it has a compliance one.
Operate clusters as versioned decision infrastructure, not permanent categories.
Position
Cluster 4 in the new fit is not cluster 4 from the old one
Downstream systems do not consume clusters. They consume integers — a dashboard filter, a routing rule, a scheduled report — and the integer is the one part of the output that carries no meaning by itself. Refitting can permute the labels, split one group, merge several, or open a new unknown region. A numeric ID has no continuity across versions unless an explicit alignment process establishes it. This lesson's own example is the ordinary case rather than an exotic one: cluster 2 in a new fit overlapping mostly with old cluster 4, and dashboards built on the assumption that the number meant something.
Leaving the fit alone is not the safe option either. The Scientific Reports team that aged four standard models across 32 datasets from healthcare operations, transportation, finance and weather — 128 model-and-dataset pairs in all — “observed temporal model degradation in 91% of cases”. Standing still is itself a decision. Its cost is measurable, and it is paid quietly: Google Flu Trends delivered a weekly estimate on schedule through 100 of the 108 weeks in which it was running too high.
Software solved the smaller version of this problem by announcing it. Semantic Versioning reserves the first number for breakage, incrementing the “MAJOR version when you make incompatible API changes”. A refit that splits or merges groups is exactly that kind of change, whatever the response schema of the assignment service still looks like.
One regulator has gone further and made the announcement a precondition. The FDA's final guidance on predetermined change control plans for AI-enabled device software functions, announced in December 2024, requires a PCCP to describe the planned modifications, the methodology to develop, validate and implement them, and an assessment of their impact. The notice explains what that buys: “FDA reviews the PCCP as part of a marketing submission for a device to ensure the continued safety and effectiveness of the device without necessitating additional marketing submissions for implementing each modification described in the PCCP.” The joint FDA, Health Canada and MHRA guiding principles of October 2023 add the piece most teams leave out, requiring plans to include “mechanisms to detect and revert or stop implementation of a change that fails to meet specified performance criteria”. Declare the change, validate it, assess its impact, and keep the trigger that reverts it.
So ship a cluster version the way a library ships a release, or the way that guidance ships a modification: an overlap matrix and a chance-corrected agreement score against the previous fit, profiles for every group, a lineage recording splits, merges, births and deaths, a migration for each consumer, and a rollback condition written down before launch. A report still reading last quarter's IDs is not a stable report. It is an unmigrated dependency.
A refit is a release, and a split group is a breaking change.
Key takeaways
- New observations need an assignment rule and explicit unknown-regime behavior. Whether a fitted model can assign at all is fixed by the algorithm — scikit-learn documents each method as inductive or transductive.
- Cluster labels have meaning only within a versioned artifact set; the adjusted Rand index of Hubert and Arabie (1985) works precisely because it ignores the names attached to the groups.
- Refits can split, merge, permute, create, or retire groups. Under Semantic Versioning that is a MAJOR change, and under the FDA's predetermined change control plans it is a modification declared, validated and impact-assessed in advance.
- Monitoring should cover profile, boundary, unknown, action, and population drift. A 2022 Scientific Reports study found temporal degradation in 91% of 128 model-and-dataset pairs, and GMLP principle 10 makes monitoring and retraining risk one subject.
- Consumer migration and rollback are part of cluster-model deployment, and undeclared consumers are a catalogued antipattern rather than an unlucky edge case.
- Retirement removes obsolete uses while preserving historical interpretability — and it can be costly: Zillow's wind-down carried an approximately $304 million write-down and roughly 25% of its workforce.