Unsupervised learning, concretely
What it is
There is no y. You hand the algorithm a matrix and it returns a label per row, invented by the algorithm. Nothing in the data says whether those labels are right, so every judgement is either internal (a geometric score computed from the same data) or external (a human looking at the groups and deciding they mean something).
Why it matters
It changes what 'it worked' can possibly mean. Supervised learning has a ground truth that punishes a wrong answer; clustering always returns an answer, and running k-means with k=4 on uniform noise produces four confident, well-separated, entirely meaningless clusters.
In the real world: Grouping customers by behaviour when nobody has labelled them, to find segments marketing can target.
import numpy as np
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
rng = np.random.default_rng(0)
noise = rng.uniform(0, 1, (600, 2)) # no structure whatsoever
labels = KMeans(n_clusters=4, n_init=10, random_state=0).fit_predict(noise)
np.bincount(labels) # four tidy, balanced groups
silhouette_score(noise, labels) # about 0.36 — not obviously badTreating cluster labels as discovered categories. The integers are arbitrary and unstable: re-run with a different random_state and cluster 0 becomes cluster 2. Never join on a cluster id across two fits, and never report 'segment 3' to anyone without a description of what is in it.