1. Home
  2. Explore
  3. Computer Science
  4. Unsupervised Machine Learning

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Unsupervised Machine Learning

Speaker 1Speaker 2

Unsupervised Machine Learning

6:11
0:00-6:11
  1. Simon

    So, Michael, I recently watched a talk on unsupervised machine learning, and it really clarified how it differs from supervised learning. In supervised learning, you have a response variable you're trying to predict or explain, right? But in unsupervised learning, you just have the data—no labels at all.

  2. Michael

    Exactly. And that's what makes it both powerful and tricky. Without a response, you can't do classification in the usual sense. Instead, you're looking for patterns or structure in the data itself. The talk gave a great example: with two features, in supervised learning you'd draw a boundary between labeled groups, but in unsupervised, all points are gray—you're trying to see if there are natural groupings.

  3. Simon

    Right. And the speaker emphasized that unsupervised learning is often used in exploratory data analysis—alongside data wrangling and visualization. It helps generate hypotheses, but you have to be careful: if you test those hypotheses on the same data, the findings are still exploratory and might not be reproducible.

  4. Michael

    That's a crucial point. He recommended a validation pipeline—like training-test splits or cross-validation—applied to the whole process, from preprocessing through clustering or dimension reduction to any downstream supervised analysis. Otherwise, you risk overinterpreting patterns that are just noise.

  5. Simon

    Let's get into the two main classes he covered: clustering and dimension reduction. Clustering aims to group objects so that points within a cluster are more similar than points in different clusters. But that definition is vague—different definitions of 'similarity' or 'meaningful' can lead to very different clusterings.

  6. Michael

    Absolutely. He showed a simple scatter plot where one person might see two clusters, another six, and another four—all reasonable. And the choice of similarity measure matters too. For example, you could use Euclidean distance or something else, and that changes the clusters you get.

  7. Simon

    And you also have to decide what to cluster: observations, features, or both (biclustering). The talk focused on clustering observations, but the same ideas apply elsewhere. Then we looked at two types of clustering: hierarchical and partition-based, with k-means as the main example of the latter.

  8. Michael

    Hierarchical clustering produces a dendrogram—a tree showing nested clusters. He explained that you can build it bottom-up (agglomerative) or top-down (divisive). With bottom-up, you start with each point as its own cluster and merge the closest ones step by step.

  9. Simon

    To decide which clusters to merge, you need a linkage function—a measure of distance between clusters. Three common ones: single linkage (minimum distance between points), complete linkage (maximum distance), and average linkage (average distance). Each has strengths and weaknesses.

  10. Michael

    Single linkage can handle non-spherical shapes but is sensitive to outliers and noise—it often 'chains' points together. Complete and average linkage are more robust to outliers but prefer roughly spherical clusters of comparable size. In high-dimensional data, single linkage tends to chain, so it's less useful there.

  11. Simon

    The dendrogram's vertical axis shows how dissimilar clusters are—earlier fusions mean higher similarity. The horizontal axis is arbitrary, so you can't interpret proximity of leaves. By cutting the dendrogram at different heights, you get different numbers of clusters. You look for big gaps where the height jumps.

  12. Michael

    He gave a nice example with the NCI60 cancer cell line data, showing that in high dimensions, dendrograms become messy—especially with single linkage, which chains. So in practice, complete or average linkage are often preferred.

  13. Simon

    Now, k-means clustering is different. It partitions data into a pre-specified number k of clusters by minimizing the within-cluster sum of squares. The algorithm is simple: randomly assign points to clusters, then iterate between calculating cluster centroids and reassigning each point to the nearest centroid until convergence.

  14. Michael

    K-means is efficient and has a clear objective, but it doesn't produce a hierarchy—changing k gives completely different clusters. It works best for compact, spherical clusters of similar size. It can also produce empty clusters, which you'd remove and re-run.

  15. Simon

    He compared k-means and single linkage on several examples. K-means handled well-separated spherical clusters, but failed on nested or irregular shapes, where single linkage succeeded. Conversely, single linkage struggled with overlapping clusters, while k-means separated them nicely.

  16. Michael

    Choosing the number of clusters is a challenge in both methods. For hierarchical clustering, you can look at the dendrogram for gaps. For k-means, you can plot the objective function against k and look for an 'elbow'. But these are heuristics—the best approach is to validate via a downstream task with cross-validation.

  17. Simon

    He also warned that preprocessing like centering and scaling can greatly affect clustering results. So it's important to think about those steps as part of the pipeline.

  18. Michael

    Let's move to dimension reduction, with PCA as the star. The goal is to find a lower-dimensional representation that captures most of the variability in the data. This helps with visualization, removing redundancy, and denoising.

  19. Simon

    PCA works by finding linear combinations of the original features—principal components—that maximize variance. The first PC is the direction of greatest variance. Subsequent PCs are orthogonal to all previous ones and also maximize variance. In practice, you project data onto the first few PCs.

  20. Michael

    He showed a biplot of US crime data, where with four variables, the first two PCs revealed interesting patterns: PC1 seemed like an average of all crime rates, while PC2 contrasted murder/assault with rape/urban population. That insight was hard to see from pairwise scatter plots.

  21. Simon

    Again, choosing the number of PCs is tricky. You can look at a scree plot, but the best way is to use PCA as part of a supervised pipeline, like principal component regression, and use cross-validation to pick the number that gives the best prediction.

  22. Michael

    Right. And during the Q&A, the speaker addressed a few important points. One was about the choice of distance metric in clustering—there's no universal best, so you should try several and validate which gives more generalizable results.

  23. Simon

    Another question was about rotating axes in PCA. He clarified that PCA itself is a rotation, giving a new coordinate system where axes are orthogonal. The challenge is deciding which PCs to examine—like PC1 vs PC2 or PC1 vs PC3—and that requires inspecting the data.

  24. Michael

    And someone asked about the balance between user input and automation in unsupervised learning. He said that unsupervised methods often require more data scientist involvement—it's hard to fully automate. But you must avoid overfitting by validating on independent data.

  25. Simon

    Finally, they discussed how supervised and unsupervised learning can work together. For pure prediction, you might use PCA then regression; for understanding associations, you'd need different methods because PCs are combinations of original features.

  26. Michael

    To sum up: unsupervised learning is a vital part of data analysis, but it's not a standalone solution. It's best used in a pipeline where results are validated through downstream tasks or independent data. And always be cautious about overinterpreting exploratory findings.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent