Unsupervised Learning

Unsupervised learning is machine learning on data that has no labels. The model explores the data on its own to find hidden structure, such as natural groups or patterns.

Data & AI

Because there are no correct answers to compare against, the model looks for similarities and differences by itself. Common tasks include clustering (grouping similar items) and dimensionality reduction (compressing data while keeping its important structure).

Imagine handing someone a box of mixed photos with no labels and asking them to sort them into piles that 'go together.' They'd group by color or subject without being told the categories — that's the spirit of unsupervised learning.

Examples

Python

from sklearn.cluster import KMeans
import numpy as np

X = np.array([[1, 1], [1.5, 2], [8, 8], [9, 9]])
labels = KMeans(n_clusters=2, n_init=10).fit_predict(X)
print(labels)

Output:

[1 1 0 0]

Learn it in a lesson

See also

Back to the Dictionary