Unsupervised Learning
The agency has 5,000 listings and a vague question: "What kinds of flats do we actually have?" Nobody has labelled them as "budget", "family" or "luxury", and nobody knows how many kinds there are. Unsupervised learning works exactly here, on data with no answer key.
The rule
No labels: the model finds structure, such as groups, directions or oddities.
Three jobs cover most unsupervised work:
- Clustering: put similar items into groups. Flats might fall into small-and-cheap, mid-size-near-metro and large-and-pricey. k-means is the classic method: choose starting centres, assign every item to its nearest centre, move each centre to the average of its members, and repeat until nothing changes.
- Dimensionality reduction: describe each item with fewer numbers while keeping most of the variation. Principal component analysis (PCA) uses the eigenvectors from the linear algebra section as new axes and keeps only the ones with the largest eigenvalues. Forty listing features might shrink to three, making the data easier to plot and faster to model.
- Anomaly detection: flag items that fit no pattern. A listing claiming 40 m² for ₹80 thousand, on a street where similar flats rent for 14 to 16, stands out.
Because there are no labels, there is no accuracy score. You judge the result by whether it is useful: do the clusters make sense to the letting team, and do the flagged listings turn out to be errors or fraud?
The shortcut
Is there a label column? If not, ask what you want: groups, fewer numbers, or oddities. That names the job: clustering, dimensionality reduction or anomaly detection.
Here is one round of k-means on the five flat sizes, 40, 50, 60, 70 and 80, with two clusters.
Start
Pick starting centres at 42 and 72.
The choice of is yours, and a different gives different groups. That is not a bug; it is why the result must be judged by usefulness.
Drills
Answer fast — trust the rule.
Group 5,000 listings into segments when nobody has defined the segments. Which job is this?
After one round of k-means on sizes 40, 50, 60, 70, 80 from centres 42 and 72, where are the new centres?
Shrink 40 listing features to 3 while keeping most of the variation. Which job is this?
A listing claims 40 m² for ₹80 thousand where similar flats rent for 14 to 16. Which job would catch it?
Why is judging a clustering harder than judging a classifier?
Remember
- No labels: the model finds structure, such as groups, directions or oddities.
- Shortcut: no label column? Decide between groups, fewer numbers or oddities.
- Trap: expecting an accuracy score, or treating one choice of k as the truth.
