Imagine being handed an enormous box full of different kinds of fruit and told to sort it, but nobody tells you which kinds are in there. So you start examining the fruit and putting like with like – red round apples together, yellow curved bananas in another pile, and the small red beads of strawberries in a third. Unsupervised learning works exactly like this. The computer is given data without any labels and searches for similarities and patterns in it by itself, so that it can sort the data into logical groups. It needs no “teacher” telling it what is right; it learns by observing and comparing.
Unsupervised learning is the machine learning paradigm in which the algorithm works with a dataset containing no predefined labels or target outputs. The model’s aim is not to predict the correct answer but to identify hidden patterns, structures and relationships directly in the data on its own. The main tasks addressed by unsupervised learning are clustering, which groups similar data points into clusters, association rule mining, which uncovers relationships between variables in the data, and dimensionality reduction, which simplifies data by reducing the number of variables while retaining the essential information. An example is segmenting customers into groups on the basis of their purchasing behaviour with no prior knowledge of those groups.