Unsupervised learning is the type of machine learning that draws inferences from data without labels: the algorithm sees only the inputs, with no target to predict, and must find structure in them itself. In probability terms, supervised learning models p(y | x), while unsupervised learning studies p(x): where the data is dense, how it groups, which variables move together and which points are unusual.
Its main tasks are clustering, dimensionality reduction, density estimation, anomaly detection and association rules. Three standard algorithms are k-means clustering, principal component analysis (PCA) and DBSCAN; hierarchical clustering, Gaussian mixture models, isolation forest and autoencoders also count. When asked for examples, name algorithms: clustering and anomaly detection are tasks.
k-means assigns each point to the nearest of k centroids, moves each centroid to the mean of its points, and repeats until nothing changes. PCA projects the data onto the orthogonal directions of greatest variance. An isolation forest scores each point by how few random splits it takes to separate it from the rest, so a bank with a million card transactions and no fraud labels can send the 1,000 most isolated to an analyst. Association rules count co-occurrence: if 200 of 1,000 receipts contain bread and 100 contain both bread and butter, the rule bread → butter has 10% support and 50% confidence.
Expect a follow-up on choosing between them. k-means needs k in advance and favors round clusters of similar size. DBSCAN finds clusters of any shape and labels outliers as noise, but struggles when density varies. Hierarchical clustering gives a dendrogram you can cut at any level, but needs all pairwise distances, so it scales poorly.
Evaluation is the other usual follow-up. With no ground truth there is no accuracy, so you judge results by internal scores such as the silhouette, by whether they help a downstream model, or by expert review. k-means returns k clusters even from random noise, and the choice of features, scaling and distance shapes what gets found. In practice, unsupervised output often feeds a supervised model as cluster IDs or compressed features.