AI · LESSON 07 / 25 · English
Unsupervised Learning
Find structure without being given class labels.
Content reviewed: 22 October 2026 · தமிழில் படிக்க ↗
Understand it in plain language
Unsupervised learning looks for patterns without a supplied target label for each example. Clustering groups similar items; dimensionality reduction builds a compact representation. A cluster is not automatically a meaningful real-world category, and the result depends on features, distance, scaling, and algorithm choices.
How the AI approach works
Unsupervised learning explores structure without a supplied target label for every example. Clustering, representation learning, dimensionality reduction, and density modeling answer different questions. An anomaly score can identify unusual examples, but “unusual” does not automatically mean fraudulent, defective, or harmful.
K-means alternates two operations: assign each point to the nearest center, then move each center to the mean of its assigned points. It seeks a small within-cluster squared-distance objective. The requested number of clusters k, initialization, feature scaling, and outliers all influence the result. The algorithm favors particular shapes in the chosen feature space; it does not discover one uniquely correct social or business classification.
Other methods encode different assumptions. Density-based clustering can find irregular dense groups and mark some points as noise. Hierarchical clustering creates nested groupings. PCA finds directions of large variance for a lower-dimensional linear representation; the directions with most variance are not necessarily the most useful for a later prediction task.
Evaluate whether structure is stable and useful. Inspect representative examples, vary choices, and check whether groups reflect meaningful content or accidental features such as message length or language. If you later use these features in a supervised model, fit the transformation within the training split to avoid leakage.
Break the idea into steps
- Choose features that make similarity meaningful for the task.
- Scale features thoughtfully before comparing distances.
- Inspect clusters and validate whether they help the actual use case.
Worked example: connect the method to the task
A course team clusters support messages to discover recurring issues. One cluster contains short Tamil messages and another contains long English messages. That may reflect representation choices rather than different support needs. Inspect samples and compare multilingual representations before naming the clusters “beginner” and “advanced.”
The code experiment below implements the full assignment-and-update loop for one-dimensional k-means. It teaches that specific algorithm. It does not establish that real students or messages naturally belong to two groups.
Algorithm experiment: predict, change, explain
Run the full assignment-and-update loop. Change the initial centers or add an outlier and inspect the new means. This is one-dimensional k-means, not a claim about natural human categories.
points = [1, 2, 3, 9, 10, 11]
centers = [1.0, 9.0]
for iteration in range(10):
groups = [[], []]
for point in points:
cluster = min(range(2), key=lambda j: abs(point - centers[j]))
groups[cluster].append(point)
updated = [sum(group) / len(group) if group else centers[j]
for j, group in enumerate(groups)]
print("iteration", iteration + 1, "centers:", updated)
if updated == centers:
break
centers = updated
print("groups:", groups)Predict first, then reveal the checked output
iteration 1 centers: [2.0, 10.0] iteration 2 centers: [2.0, 10.0] groups: [[1, 2, 3], [9, 10, 11]]
Change one thing. Run it again.
Run this small, self-contained experiment in standard Python. No package installation or paid API is required. Change the suggested variable and explain the effect on the method before applying it to real data.
Let the editor finish loading, load this example, then press Run.
The free editor uses OneCompiler, an external service. Code you run is sent there. Do not enter passwords, API keys, or private student data. If an example is sent before the editor is ready, wait and load it again.
Apply the idea: check your reasoning
Think before revealing the answer
If we change rupees to paise for one feature but leave another unchanged, can clustering change?
Reveal the answer and reasoning
Yes. Distance-based methods are sensitive to relative scales. Choose and document scaling based on the meaning of features; a unit change should not silently redefine similarity.
A common mistake: A cluster number is just an identifier. Group 1 is not inherently better than group 0.
Before you move on
- Explain the main idea without repeating the technical label.
- Identify the approach, its assumptions, and the evidence needed to trust the result.
- Complete the challenge, then compare your reasoning with the answer.
Sources & a deeper next step
The refresh uses primary papers and official documentation. These optional links are in English; you can understand this lesson without reading them first. Product versions and availability can change.