Chapter 9: Unsupervised Learning Techniques

Will Toth
3 min readJun 18, 2021

A Review of Hands-On Machine Learning with Scikit-Learn, Keras & Tensorflow by Aurélien Géron

Apparently Medium images aren’t supposed to be related to the article ;)

Summary

Unsupervised Learning is likely what people think of when they think about machine learning. It is the act of just exposing a machine to a set of data and the machine being capable to derive conclusions or some sort of value from that data. Unsupervised Learning differs from Supervised Learning because the data that is used is unlabeled or only partially labelled. Thus, the machine is unsupervised and can interpret the data into whatever categories it sees fit. These methods are usually extremely math heavy but can help to provide meaning to data that would otherwise just go relatively unused.

Clustering

Clustering is exactly what it sounds like, classifying things (in this case data points) into a grouping of like things. An easy way to think about this is just to imagine a set of fruits. Now plot these fruits on a 2-dimensional plot with the y-axis you have color and on the x-axis you have shape. In this imaginary example fruits will divide themselves into different clusters like yellow and moon-like will have a concentration of bananas while red and spherical will have a concentration of apples. But, what about oranges and grapefruits? They are both round and spherical. Well, to solve this we can add a third dimension to our graph, size (or more precisely volume). Now *most* oranges and grapefruits can be categorized into separate clusters. And even though our machine learning model doesn’t understand that we have subdivided oranges and grapefruits it has effectively identified two different clusters in the data that can later be interpreted by humans.

K-Means

K-Means is a simple and efficient algorithm for clustering unsupervised data. The algorithm it uses starts with the assumption that you know how many centroids (number of clusters) and plots them randomly on a graph of the data. Then, you label the data points on the graph based on what centroid is closest to those data points. Then, you update the centroids to be closer to the middle of all of their data points and relabel the data points to their closest centroid. From here you repeat this process until the centroids and data points stop changing resulting in the optimal clusters (assuming you chose the optimal number of centroids. However, K-Means has many weaknesses not the least being that it only works on spherical shaped clusters and has difficulty with other shapes.

My thoughts

This was a great chapter to end part one of the book on. Before reading this chapter I had a general understanding of unsupervised learning but had not learned any of the methods by which you would do it. I was honestly not shocked by how abstract the concepts were seeing how difficult solving problems with unlabeled data seems. Additionally, this was my first time reading about semi-supervised learning and I think that it seems really useful since we aren’t always given labelled data to work with. It seems like a cool human-aided form of machine learning where you can use small amount of human interaction to increase the quality of learning.

Thanks for reading!

If you have any questions or feedback please reach out to me on twitter @wtothdev or leave a comment!

Additionally, I wanted to give a huge thanks to Aurélien Géron for writing such an excellent book. You can purchase said book here (non-affiliate).

Disclaimer: I don’t make any money from any of the services referenced and chose to read and review this book under my own free will.

p.s. Thanks Alex for the inspiration to post totally random images on my articles lol

--

--