Supervised vs Unsupervised vs Reinforcement Learning: Data, Goals
Machine learning can be divided into three broad types by what it uses as a guide when learning from data. Supervised learning is given pairs of inputs and correct answers (labels) and learns a model that predicts the answer from the input. Unsupervised learning finds groups of similar items, or structures that represent the data with fewer variables, from data alone with no correct answers. Reinforcement learning has an agent (the learner) choose actions in an environment and, through trial and error, learn a way of choosing actions (a policy) that maximizes the total reward it receives as a result. The basic rule: supervised learning when correct answers are available and you want predictions, unsupervised learning when there are no answers and you want to understand the data's structure, and reinforcement learning when you want the learner to judge a sequence of actions by its outcome.
| Aspect | Supervised learning | Unsupervised learning | Reinforcement learning |
|---|---|---|---|
| Training data | Pairs of inputs and correct answers (labels) | Input data only, with no correct answers | Records of states, actions and rewards from interacting with an environment, collected while acting rather than prepared in advance |
| How correct answers are given | The correct output is given for each input | Not given | No correct answer per action; only an evaluation, the reward, which often arrives with a delay |
| Learning goal | Predict the output correctly for new inputs | Find groups and structure in the data | Find a policy that maximizes the total reward received over time |
| Main tasks | Regression (predicting numbers) and classification (predicting classes) | Clustering, dimensionality reduction, anomaly detection | Choosing sequences of actions (controlling machines, moves in games, deciding orderings and so on) |
| Typical methods | Linear regression, logistic regression, decision trees, support vector machines, neural networks | k-means clustering, hierarchical clustering, principal component analysis (PCA) | Q-learning, policy gradient methods |
| How to evaluate | On held-out test data, compared with the correct answers using accuracy, precision and recall, mean squared error and so on | Hard to evaluate without correct answers; judged by measures of how well groups hold together, or by whether people find the results meaningful | By the total reward obtained (cumulative reward) |
| Main difficulties | Preparing labels takes time and money; overfitting must be watched | Hard to judge whether results are good, and people must interpret what the groups found mean | Tends to need many trials; trying things on real equipment is risky and costly, so simulation is often used; designing the reward is also hard |
| Examples of use | Spam filtering, image recognition, demand and price forecasting, predicting equipment failures | Customer segmentation, data visualization and preprocessing for learning, detecting fraudulent transactions and equipment anomalies | Games such as Go, robot control, tuning language model outputs to match human evaluations |
Figures are typical orders of magnitude and vary by process generation and product.