Learning Objectives
By the end of this topic, you should be able to:
- Explain what unsupervised learning is trying to accomplish and how the absence of labels changes the learning problem.
- Explain how K-means clustering works at a conceptual level: what a centroid is, how points are assigned to clusters, and what makes the algorithm stop.
- Identify at least two limitations of K-means clustering.
- Explain what dimensionality reduction is and why high-dimensional data is difficult to work with directly.
Learning Activities
To help you meet the learning objectives, we have prepared a combination of readings, activities, and videos.
Course Readings
These reading were designed to introduce the course topics to an audience of educators. They should be considered "required" and read in order.
- Reading 1 – Finding Structure Without Labels — what unsupervised learning is trying to do, clustering as the core technique, and K-means traced step by step on a school-based example
- Reading 2 – Seeing the Shape of Data — dimensionality reduction, why high-dimensional data is hard to work with, PCA and t-SNE as tools for revealing hidden structure
- Reading 3 – Unsupervised Neural Networks and the Bridge to LLMs — autoencoders, unsupervised pretraining, and why the largest AI systems in the world are built on a foundation of unlabeled data
Supplemental Readings
Some participants find it helpful to read about a topic from a source written for a slightly more technical audience. These supplemental readings cover similar material as the course readings but may not fully align with the course learning objectives. Use them as an optional complement to your study, not a substitute for the course readings.
- Reading: IBM, What is Unsupervised Learning?
Lesson Videos
These videos support the readings above and may present the material with some deeper connections and worked examples.
Checking for Understanding, Questions
Clustering
- Explain in your own words what K-means clustering is doing at each step. What is a centroid? What does it mean for a data point to be assigned to a cluster? What makes the algorithm stop?
- A school counselor uses K-means on three years of student data and discovers four clusters. She labels them herself: "academically engaged," "socially connected but academically disengaged," "quietly struggling," and "broadly disengaged." What did the algorithm contribute to this result, and what did the human contribute? Could the algorithm have produced the labels on its own?
- K-means requires you to specify the number of clusters K before the algorithm runs. Why is this a limitation? What might go wrong if K is too small? Too large?
Dimensionality Reduction
- A dataset of student performance records has 40 attributes per student. After PCA, the data is represented in 3 dimensions. What has been preserved? What has been lost? Why might the 3-dimensional version be more useful for some purposes despite having less information?
- Explain why visualizing 40-dimensional data directly is impossible for humans, and how dimensionality reduction makes visualization possible. What is the risk of drawing conclusions from a 2D visualization of 40-dimensional data?
Autoencoders and Pretraining
- An autoencoder is trained to reconstruct its inputs. It has no labels and no "correct answers" in the usual sense. In what sense is it still learning something? What is it learning?
- Large language models are pretrained on hundreds of billions of words of text without any labels. The training task is simply: predict the next word. Why does successfully learning to predict the next word require the model to learn something much deeper than word sequences?
- Supervised learning requires labeled data, which is expensive to produce. Unsupervised pretraining uses unlabeled data, which is abundant. Explain why this difference matters for what kinds of AI systems are now possible to build.
Checking for Understanding, Answers
You can compare your answers to the following answer key.
Show Answer Key
Clustering
- K-means works in an iterative cycle: (1) Initialize — place K centroids randomly in the data space. (2) Assign — assign each data point to the nearest centroid; that centroid's cluster now "owns" that point. (3) Update — recalculate each centroid as the mean (average position) of all points currently assigned to it; centroids move. (4) Repeat — reassign all points to the (now-moved) nearest centroid. The algorithm stops when no point changes its cluster assignment between iterations — the centroids have stabilized. A centroid is the geometric center of a cluster — the average of all data points currently assigned to it, not necessarily an actual data point itself.
- The algorithm contributed the numerical groupings — it identified which students were mathematically similar to each other across whatever attributes were in the dataset, without any human guiding what "similar" should mean. The human contributed the labels and their interpretation — K-means outputs group memberships, not names or meanings. The counselor looked at the characteristics of students in each cluster and decided what to call them. No, the algorithm could not produce labels on its own: unsupervised learning discovers structure but has no concept of what that structure means. Meaning requires human judgment and domain knowledge.
- Requiring K in advance is a limitation because the "right" number of clusters in real data is often unknown before analysis. If K is too small: genuinely distinct groups are merged together, obscuring real structure and producing misleading centroids that represent no actual student profile well. If K is too large: the algorithm artificially splits natural groups into sub-clusters that don't correspond to meaningful distinctions, producing clusters that are hard to interpret and may reflect noise rather than real patterns.
Dimensionality Reduction
- PCA preserves the directions of greatest variance in the data — the combinations of attributes that explain the most variation between students. The 3-dimensional representation captures the major axes of difference across the student population. What is lost: the fine-grained details captured by the other 37 dimensions — subtle distinctions that explain less of the overall variation. The 3D version may be more useful for some purposes because: it is small enough to visualize, analyze, and apply clustering or other techniques to efficiently; it filters out noise (minor variation that may be measurement error rather than signal); and it reveals the dominant structure that would be buried in 40-dimensional complexity.
- Humans can only perceive and visualize 2 or 3 spatial dimensions simultaneously. There is no physical or cognitive way to directly perceive a 40-dimensional space. Dimensionality reduction mathematically compresses the data into 2 or 3 dimensions that preserve as much structure as possible, making it viewable as a scatter plot. The risk: any 2D projection of 40-dimensional data necessarily discards information. Clusters that appear separate in 2D might actually overlap in the other 38 dimensions; clusters that look merged might actually be distinct. Conclusions drawn from the 2D view may not accurately reflect the full-dimensional structure of the data.
Autoencoders and Pretraining
- The autoencoder is learning something meaningful, despite having no external labels: it is learning a compact internal representation of its inputs. To successfully compress an input into a much smaller bottleneck layer and then reconstruct it accurately, the network must learn which features of the input are essential and which are redundant. The bottleneck forces it to discover the underlying structure of the data — the compact representation captures what matters most. This is precisely what makes autoencoders useful for dimensionality reduction and for initializing other models.
- To predict the next word in a sentence, the model must implicitly represent an enormous amount of world knowledge. Predicting that "The patient took the medication prescribed by the ___" ends with "doctor" (or similar) requires understanding medical contexts, professional roles, and grammatical structure. Predicting "The Eiffel Tower is located in ___" requires geographic knowledge. The task forces the model to build internal representations that encode facts about the world, relationships between concepts, grammatical structure, and contextual coherence — all inferred purely from patterns in text, without any explicit labels for any of these things.
- Labeled data requires human effort to create — experts must examine each example and assign a correct label. For many problems, labeling is extremely expensive or requires rare expertise. This limits supervised learning to problems where labeled datasets can realistically be assembled. Unlabeled data, by contrast, is abundant: the entire internet, all books ever written, all scientific papers, all news articles — none of it requires labeling to use as training data. Unsupervised pretraining makes it possible to train models at a scale that would be completely impossible with supervised learning, enabling capabilities that no labeled dataset could ever provide.
Extend Your Learning
The following resources go a little deeper on topics we touched on but did not fully explore in the readings. These are entirely optional — none of this material appears on the Competency Demo — but each one is a natural "next question" from something covered this week.
-
Generative adversarial networks (GANs)
A powerful unsupervised approach where two networks compete: one generates fake data, the other tries to distinguish real from fake. Through competition, both improve — producing the photorealistic synthetic images that made "deepfakes" possible. This article from MIT Technology Review covers how GANs work and why they matter.
The GAN Father — MIT Technology Review