Lesson 5 · Machine Learning
Unsupervised Learning
6 min
You'll be able to
- Explain clustering and dimensionality reduction
- Describe a real clustering use case
- Contrast supervised and unsupervised goals
Unsupervised learning finds structure in data without labels. Clustering groups similar points; dimensionality reduction compresses data while preserving its shape.
Everyday uses
- Customer segmentation in marketing.
- Anomaly detection in fraud and network security.
- Recommender systems that find hidden groups of users.
from sklearn.cluster import KMeans
kmeans = KMeans(n_clusters=3, random_state=0)
kmeans.fit(X) # X has no labels
clusters = kmeans.labels_ # each row assigned a groupChallenge
Segment a store
Brainstorm three customer segments a bookstore might discover with clustering, and what feature each cluster might be based on.
Knowledge Check
Unsupervised learning
Clustering is a supervised learning technique.
A good use of clustering is:
Answer all questions to submit.