---
title: "Clustering: Structure Without Labels"
description: "With no target column, the question becomes which examples resemble each other. K-means alternates assigning points to the nearest centre and moving the centres, and the awkward parts are choosing k, "
canonical: https://lightmysky.com/learn/computing/clustering-structure-without-labels-mt_BAMGOlWgRY
source: https://lightmysky.com/learn/computing/clustering-structure-without-labels-mt_BAMGOlWgRY.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Clustering: Structure Without Labels

With no target column, the question becomes which examples resemble each other. K-means alternates assigning points to the nearest centre and moving the centres, and the awkward parts are choosing k, choosing a distance, and deciding whether the groups mean anything.

Subject: Computing · Area: Machine Learning · Ages 20 to 22
Page: https://lightmysky.com/learn/computing/clustering-structure-without-labels-mt_BAMGOlWgRY

## Ready when they can

- Run two rounds of k-means by hand on a small set of points
- Show how different starting centres give different final groups
- Say what makes a clustering result meaningful rather than merely tidy

## Lesson: Groups with no right answers attached

With no target column, the question becomes which examples resemble each other. K-means answers it by alternating two steps: assign every point to its nearest centre, then move each centre to the middle of its new group. Repeat the pair until the groups stop moving.

**Example.** Run two rounds by hand on points at 1, 2, 8 and 9, with starting centres at 1 and 9. Round one assigns 1 and 2 to the first centre and 8 and 9 to the second, then the centres move to 1.5 and 8.5. Round two assigns the same way, so the groups hold. Now notice the trap: different starting centres can end in different final groups.

Before running k-means you must choose k, the number of centres, plus the distance you measure with. K-means is happiest when points form round, similarly sized blobs, since it always builds groups around a centre point. A wrong k forces the data into neat round groups that do not really exist.

**Tip.** A clustering result is not meaningful just because the algorithm finished. It is meaningful when the groups are tight inside, well separated from each other, and say something true about the data. Other shapes need other tools: DBScan walks point to point pulling in close neighbours, so it can find long stretched groups and label stray points as noise.

**Recap.** Alternate assign and move, choose k and distance with care, and trust only groups that are tight, separated and true.

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Data as a Matrix: Rows, Features and the Target](https://lightmysky.com/learn/computing/data-as-a-matrix-rows-features-and-the-target-mt_KEN-TU1Gpn)
- [Inner Products, Length and Orthogonality](https://lightmysky.com/learn/mathematics/inner-products-length-and-orthogonality-mt_X0HPRGto4W)
- [Decision Trees and Ensembles](https://lightmysky.com/learn/computing/decision-trees-and-ensembles-mt_xo9EEd4R1i)

## Opens up

- [Generative Models: Learning a Distribution You Can Sample](https://lightmysky.com/learn/computing/generative-models-learning-a-distribution-you-can-sample-mt_3CHsmpWVX5)
- [Single-Cell Analysis: Normalisation, Embedding and Naming Cell States](https://lightmysky.com/learn/science/single-cell-analysis-normalisation-embedding-and-naming-cell-states-mt_diYHLaLmij)
- [Principal Components and Dimensionality Reduction](https://lightmysky.com/learn/computing/principal-components-and-dimensionality-reduction-mt_l-9XHg_ChZ)
