Supervised learning
Supervised learning trains models on labeled data, where each input example has a corresponding target (label). The model’s objective is to learn a mapping from inputs (features) to outputs (labels) so it can predict labels for new, unseen inputs. Common supervised tasks:- Classification — categorical outputs (e.g., spam vs. not spam; cat vs. dog).
- Regression — continuous outputs (e.g., house prices, credit scores).
- Linear/logistic regression, decision trees, random forests, support vector machines, gradient boosting (XGBoost, LightGBM), and neural networks.
- Requires labeled training data; labels can be expensive to obtain.
- Performance is measured with metrics like accuracy, precision/recall, F1, ROC AUC (classification) or MAE/MSE/R2 (regression).
- Models need maintenance and retraining to handle concept drift (when the underlying data distribution changes).
- Predicting house prices using features such as square footage, location, and number of bedrooms.
- Email spam detection using labeled emails to classify new messages.
- Credit scoring to estimate default risk or creditworthiness from historical customer data.


Unsupervised learning
Unsupervised learning finds structure in unlabeled data. Instead of predicting labels, these methods discover patterns, compress representations, or flag unusual observations. Key unsupervised tasks:- Clustering — group similar instances (e.g., customer segmentation).
- Dimensionality reduction — reduce feature space for visualization or downstream models (PCA, t-SNE, UMAP).
- Anomaly detection — identify unusual or outlier data points (useful in monitoring and security).
- You lack labeled examples or labels are costly to obtain.
- You want to explore data, generate features, or detect novel events.
- Internal metrics: silhouette score, Davies–Bouldin index (for clustering).
- Reconstruction error or log-likelihood (for autoencoders, probabilistic models).
- Domain validation: manual inspection, A/B tests, or downstream supervised tasks.


Reinforcement learning
Reinforcement learning (RL) trains an agent to make sequential decisions by interacting with an environment and maximizing cumulative reward. RL is ideal for problems where actions influence future states and outcomes. Core RL components:- Agent — the learner/decision-maker.
- Environment — everything the agent interacts with.
- State — the current observation or context the agent receives.
- Action — a decision the agent can take.
- Reward — scalar feedback indicating immediate desirability.
- Policy — the strategy mapping states to actions.
- Value function / learning algorithm — how the agent estimates expected returns and updates the policy.
Common RL applications:
- Game playing (chess, Go, video games) — where rewards and rules are well-defined.
- Robotics — learning control policies for manipulation and navigation.
- Traffic signal control — optimizing timings to reduce congestion.
- Recommendation systems — modeled as bandits or RL when sequential feedback matters.

- RL typically requires many interactions (data/simulations) and careful exploration-exploitation balancing.
- Safe exploration and well-defined reward shaping are crucial to avoid unintended behaviors.
- Simulators and transfer learning can reduce real-world sample complexity.
Reinforcement learning can be resource-intensive to train and risky to deploy without safety checks. Use simulations, constraints, and rigorous testing before applying RL in production environments.
Comparison summary
Further reading and references
- Sutton, R. S., & Barto, A. G. — Reinforcement Learning: An Introduction.
- scikit-learn — https://scikit-learn.org/
- OpenAI Spinning Up (practical RL resources) — https://spinningup.openai.com/
These are foundational concepts for understanding AI and ML. They differ in required data, objectives, and evaluation. Make sure you understand the distinctions and representative examples — this is essential for practical applications.