Unsupervised learning practice problems

15 problems · 0 solved

Unsupervised learning finds structure in data without labels. Clustering groups similar points together, and dimensionality reduction squeezes many features into a few that still capture the shape of the data. It is like sorting a pile of mixed coins by size and colour without anyone telling you the denominations. These problems ask you to implement the common methods yourself. You will run one iteration of k-means, pick starting centroids with farthest-first and k-means++ seeding, report the explained variance ratio of PCA, compute soft memberships for a Gaussian mixture, run EM for a 1D mixture, move points one mean-shift step, merge points with single linkage clustering, find dense clusters and noise with DBSCAN, score a clustering with the silhouette coefficient, and compute t-SNE input affinities with a perplexity search. Start with the Easy problems on k-means and PCA variance. Then do k-means++, mixtures and mean shift, and finish with DBSCAN, silhouette scores, EM and t-SNE. Clustering is used for customer segments, deduplication and exploring embeddings, and interviewers often ask about k-means pitfalls and how to choose the number of clusters.

Easy 3

Medium 7

Hard 5

Related topics

All practice problems