Skip to content
  • Types of Learning · Machine Learning

Types of Learning

LearnViaNotes @learnvianotes· 3 min read

ML problems are grouped by the feedback the learner gets: labels (supervised), no labels (unsupervised), a few labels (semi-supervised), labels made from the data itself (self-supervised) or rewards (reinforcement learning).

TypeTraining dataGoalTypical tasks & algorithms
SupervisedInputs X with labels yPredict y for new XClassification, regression — linear/logistic regression, trees, SVM, boosting
UnsupervisedInputs X onlyFind structureClustering (k-means, DBSCAN), dimensionality reduction (PCA), anomaly detection
Semi-supervisedFew labelled + many unlabelled rowsUse unlabelled data to improve a supervised modelSelf-training, label propagation
Self-supervisedRaw data; labels created from the data (the next word, a masked patch)Learn general representationsPre-training language and vision models
ReinforcementStates, actions, rewards from an environmentA policy maximising cumulative rewardGame playing, robotics, recommendations as sequential decisions

Supervised vs unsupervised on the same data

The iris dataset has 150 flowers of 3 species. A classifier learns from the species labels; k-means never sees them but still finds groups that largely match them:

Python
from sklearn.cluster import KMeans
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import adjusted_rand_score

X, y = load_iris(return_X_y=True)

clf = LogisticRegression(max_iter=1000).fit(X, y)                 # supervised: uses y
print(clf.predict(X[[0, 50, 100]]))                               # [0 1 2] ← species 0, 1, 2

km = KMeans(n_clusters=3, n_init=10, random_state=0).fit(X)       # unsupervised: never sees y
print(km.labels_[[0, 50, 100]])                                   # [1 0 2] ← cluster ids are arbitrary names
print(round(adjusted_rand_score(y, km.labels_), 2))               # 0.73 ← 1.0 = perfect match, ≈0 = random; versicolor/virginica overlap

Supervised: classification vs regression

ClassificationRegression
TargetA category (spam / not spam; cat / dog / bird)A number (price, temperature, demand)
OutputClass label, usually with a probability or scoreA real value
Loss (training)Log-loss (cross-entropy), hingeSquared error, absolute error, Huber
MetricsAccuracy, precision, recall, F1, ROC-AUC, PR-AUCMAE, RMSE, R²
VariantsBinary, multi-class (one of k), multi-label (any subset of k)Single- or multi-output

Other ways to slice ML

DistinctionOne sideOther side
Batch vs onlineBatch: train on the full dataset, retrain periodicallyOnline: update incrementally as data arrives (partial_fit in SGDClassifier, MultinomialNB)
Model-based vs instance-basedModel-based: learn parameters, then discard the data (linear models)Instance-based: keep the training data and compare new points to it (k-NN)
Parametric vs non-parametricParametric: a fixed number of parameters regardless of data size (linear/logistic regression, Naive Bayes)Non-parametric: complexity grows with the data (k-NN, decision trees, kernel SVMs)
Discriminative vs generativeDiscriminative: model P(y | x) or the boundary directly (logistic regression, SVM)Generative: model how data is produced, P(x | y)·P(y) (Naive Bayes, Gaussian mixtures)

Reinforcement learning in one paragraph

An agent observes a state, takes an action, receives a reward and a new state from the environment, and learns a policy (state → action) that maximises total future reward. Unlike supervised learning, nobody gives the correct action — only delayed, scalar feedback — so the agent must balance exploration and exploitation. Q-learning, MDPs and value iteration are worked through in the Artificial Intelligence notes.

Is anomaly detection supervised or unsupervised?

What is self-supervised learning and why does it matter?

Parametric vs non-parametric — give an example of each.

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report