Types of Machine Learning
Machine learning algorithms are usually grouped by how much supervision they receive during training — that is, how much of the 'correct answer' is available while the model learns. The four broad categories are supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning. Understanding which category a problem falls into is often the single most important decision in a project, because it determines what data you need to collect, which algorithms are applicable, and how you will measure success.
Cricket analogy: Deciding whether a young player needs a batting coach (clear right answer: technique flaws shown on video), a scout spotting raw talent with no labeled comparison, a hybrid academy with a few rated prospects among many unrated trialists, or a player learning purely through match trial and error each demands a completely different training approach.
Supervised Learning
In supervised learning, every training example is paired with a known correct output, or label. The algorithm's job is to learn a mapping from inputs to outputs that generalizes to new, unlabeled inputs. Supervised learning splits further into regression, where the label is a continuous number (e.g. predicting a house price), and classification, where the label is a discrete category (e.g. predicting whether an email is spam). Because ground-truth labels exist, supervised learning has clear, well-defined evaluation metrics like accuracy or mean squared error.
Cricket analogy: Every ball faced in the nets is paired with a known outcome — dismissed, boundary, dot — and the coach learns to map bowling type to likely outcome; predicting the exact runs scored is like regression, predicting out-or-not is like classification, both judged with a clear scorecard.
Unsupervised and Semi-Supervised Learning
Unsupervised learning works with data that has no labels at all. Instead of predicting a known answer, the algorithm looks for inherent structure — grouping similar points together (clustering, e.g. k-means), reducing the number of dimensions while preserving structure (e.g. PCA), or detecting rare, anomalous points. Because there is no ground truth to check against, evaluating unsupervised results is inherently more subjective, often relying on internal metrics or downstream task performance. Semi-supervised learning sits between the two: it uses a small amount of labeled data together with a much larger pool of unlabeled data, which is common in domains like medical imaging where labeling is expensive but raw data is abundant.
Cricket analogy: With no scorecards at all, a scout groups net-session players by similar batting styles just from watching swing patterns (clustering), or condenses dozens of stroke-play stats into two key traits like power and timing (like PCA), judged only by whether the groupings feel useful; a talent academy with a handful of rated prospects among many unrated trialists mirrors semi-supervised learning.
Reinforcement Learning
Reinforcement learning (RL) is fundamentally different: an agent interacts with an environment over a sequence of steps, taking actions and receiving rewards or penalties as feedback. There is no fixed dataset of correct answers — the agent must discover, through trial and error, a policy (a strategy for choosing actions) that maximizes cumulative reward over time. RL underlies systems like game-playing agents and robotic control, where decisions have long-term consequences that a simple input-output mapping cannot capture.
Cricket analogy: A young all-rounder learns not from a labeled textbook but by actually batting and bowling over many matches, adjusting his approach as wickets and runs come as rewards, gradually discovering a winning strategy with no fixed correct-answer sheet to study.
from sklearn.linear_model import LinearRegression # supervised: regression
from sklearn.tree import DecisionTreeClassifier # supervised: classification
from sklearn.cluster import KMeans # unsupervised: clustering
from sklearn.decomposition import PCA # unsupervised: dim. reduction
import numpy as np
X_labeled = np.random.rand(100, 3)
y_labeled = X_labeled[:, 0] * 2 + 1 # supervised: labels exist
reg = LinearRegression().fit(X_labeled, y_labeled)
X_unlabeled = np.random.rand(200, 3) # unsupervised: no labels at all
clusters = KMeans(n_clusters=3, n_init=10, random_state=0).fit_predict(X_unlabeled)
print('Supervised prediction:', reg.predict(X_labeled[:1]))
print('Unsupervised cluster assignment sample:', clusters[:5])A handy analogy: supervised learning is like studying with an answer key, unsupervised learning is like sorting a pile of unlabeled photographs into groups by visual similarity, and reinforcement learning is like learning to play a video game purely from the score, with no instructions at all. And don't assume a problem is purely one type — many real systems are hybrids, e.g. using unsupervised clustering to engineer features fed into a supervised classifier, or self-supervised pretraining before supervised fine-tuning.
- Supervised learning uses labeled input-output pairs and splits into regression (continuous) and classification (discrete) tasks.
- Unsupervised learning finds structure in unlabeled data via clustering, dimensionality reduction, or anomaly detection.
- Semi-supervised learning blends a small labeled set with a large unlabeled set, useful when labeling is expensive.
- Reinforcement learning trains an agent to maximize cumulative reward through trial-and-error interaction with an environment.
- The choice of learning type constrains which algorithms and evaluation metrics are applicable.
- Real-world systems often combine multiple paradigms, such as unsupervised pretraining followed by supervised fine-tuning.
Practice what you learned
1. Which type of learning uses input-output pairs where the correct answer is known during training?
2. K-means clustering is an example of which learning paradigm?
3. What distinguishes reinforcement learning from supervised learning?
4. Semi-supervised learning is most useful when:
5. Predicting a continuous house price from features like square footage is an example of:
Was this page helpful?
You May Also Like
What Is Machine Learning?
An introduction to machine learning as the practice of building systems that improve their performance on a task by learning patterns from data rather than following hand-coded rules.
The Machine Learning Workflow
An end-to-end walkthrough of the standard machine learning project lifecycle, from problem framing and data collection through model deployment and monitoring.
k-Means Clustering
An unsupervised algorithm that partitions data into k groups by iteratively assigning points to the nearest centroid and recomputing centroids until convergence.
Logistic Regression Explained
Introduces logistic regression as a classification algorithm that models class probability via the sigmoid function, despite its regression-sounding name.