The Three Learning Paradigms

36 min
Block 0 — Locating supervised learning
Objective
be able to determine, for any problem put in front of you, which learning paradigm it belongs to; know the rigorous definition of the three paradigms and of their sub-families; be able to justify that classification by a single, defensible criterion.
Estimated duration
35 minutes
Prerequisites
chapters 001 and 002
Associated quizzes
003.1-quiz-classifying-criterion.md to 003.6-quiz-problem-qualification.md

1. The classifying criterion: the nature of the learning signal

Chapter 002 established the reversal that defines Machine Learning: rules are no longer written, they are induced from observations. Induction presupposes a signal that steers the learning — information telling the algorithm in which direction to correct its parameters.

The nature of that signal is the only criterion that separates the paradigms. One question determines it:

"For past observations, do we have the value we are trying to predict?"

Everything in this chapter follows from that question. Learn to ask it first, before considering the industry, the data format, the volume, or the algorithm someone has already suggested.

1.1 The three possible answers

Answer to the questionSignal availableParadigmStatement of the problem
Yes — every historical observation carries the target valueA known target value, observation by observationSupervised learningReproduce, on unseen cases, the input-output association observed in the data
No — no target value is availableNo external signal; only the internal structure of the data can be exploitedUnsupervised learningExpose a latent organization among the observations
No, but — a delayed evaluation of actions existsA scalar reward emitted by an environment after each actionReinforcement learningFind an action strategy that maximizes cumulative reward

For a properly formulated problem these three answers are exhaustive and mutually exclusive. A problem that appears to belong to two paradigms at once is a problem whose formulation has not been settled. The open question is then "what is the target variable", not "what is the paradigm".

DEFINITION — Learning signal and learning paradigm

Learning signal — rigorous definition

Information used by an algorithm to assess the quality of its current hypothesis and to derive from that assessment a direction in which to correct its parameters. It takes one of three forms: a target value attached to each observation, an internal consistency criterion defined on the data alone, or a scalar reward emitted by an environment in response to an action.

Learning paradigm — rigorous definition

A class of problems defined by the nature of the available signal and, consequently, by the form of the optimization problem posed: minimization of an empirical risk over labeled pairs, optimization of an internal structural criterion, or maximization of an expected cumulative reward.

In plain terms

The signal is what lets the algorithm know it is wrong. The paradigm is the family of problems defined by what you have to learn from.

Point of caution

With no signal at all there is no learning in the sense of Mitchell (1997): absent a performance measure P, no experience E can improve anything. An algorithm with nothing to be corrected against is not learning, it is computing.

1.2 The complete taxonomy

The highlighted branches mark the scope of this course. The others are defined here so that you can place them, but they are not developed further.

1.3 What is not a classifying criterion

The most expensive confusion, in project framing as in interviews, is to classify a problem by something that is not a criterion at all.

Criterion wrongly invokedImmediate counter-example
The application domainHealthcare produces supervised work (diagnosis on labeled cases), unsupervised work (patient typologies) and reinforcement work (adaptive dosing)
The data typeOne image feeds a supervised classifier just as readily as an unsupervised grouping of photographs
The model architectureA deep network can be supervised, unsupervised (autoencoder) or reinforcement-based
The data volumeTen thousand labeled rows and ten million labeled rows pose the same supervised problem; volume changes the method, not the paradigm
The business intent"Understand our customers" translates equally well into a segmentation or into a churn prediction

Guiding principle: the paradigm is read off the available data, never off the subject matter, the tooling, or the sponsor's ambition.


2. Supervised learning

2.1 Definition

DEFINITION — Supervised learning

Rigorous definition

Let X be an input space and Y an output space. We are given a training sample of n pairs

S = { (x_1, y_1), ..., (x_n, y_n) },  x_i ∈ X,  y_i ∈ Y

assumed drawn independently and identically distributed from an unknown, fixed joint distribution P(X, Y). Supervised learning consists in selecting, from a hypothesis class H, a function f: X → Y that minimizes the expected risk R(f) = E[ L(f(X), Y) ], where L is a loss function measuring the discrepancy between the predicted and the observed value. Since P is unknown, the algorithm in practice minimizes the empirical risk computed on S, subject to regularization.

In plain terms

You supply examples whose correct answer is known, and you ask the algorithm to build the function that best reproduces that correspondence, so it can be applied to cases whose answer is unknown.

On the word "supervised"

It refers to the presence of a supervisor — an operator, a process, or a later observation — that provided the correct value for each example. The supervisor acts when the dataset is assembled, never during training. By the time the algorithm runs, the supervisor is gone and only its record remains.

Point of caution

The fixed-distribution assumption is load-bearing. When P(X, Y) shifts between training and production, the empirical risk stops estimating the expected risk and performance degrades. That phenomenon is covered in chapter 082, 082.0-monitoring-and-drift.md.

DEFINITION — Labeled data

Rigorous definition

An observation for which the value of the target variable is recorded alongside the explanatory variables, that value being defined unambiguously and applied consistently across the whole dataset.

In plain terms

A row of the table whose answer is already known.

Where labels come from

Delayed observation (the loan was repaid or it was not), human annotation (a radiologist reads a scan), system records (the customer canceled), or physical measurement (the part failed at 412 hours).

Point of caution

The cost of obtaining labels is frequently the limiting factor of a supervised project. Explanatory variables are abundant; labels rarely are. A project plan that budgets for feature engineering but not for labeling is a project plan with a hole in it.

2.2 The shape of supervised learning

The label is present at training time and absent at prediction time. A setup in which the label were available at the moment of prediction would have no predictive value whatsoever — you would simply read the answer. Keep that asymmetry in mind: several of the most damaging errors in applied work, data leakage foremost among them, amount to smuggling the label back into the prediction phase.

2.3 The two sub-families

The type of the target variable determines the sub-family. Nothing else does.

ClassificationRegression
Nature of the targetCategorical: a finite set of classesNumeric and continuous
Question asked"Which class does this observation belong to?""What value does this quantity take?"
Model outputA class, usually accompanied by a probabilityA real number
Example targetLoan default: yes / noSale price: $412,500
Usual metricsAccuracy, precision, recall, F1, AUCRMSE, MAE, MAPE, R²
Representative algorithmsLogistic regression, decision trees, random forests, gradient boosting, SVMLinear regression, regularized regression, regression trees, gradient boosting
Notion of errorDiscrete: the class is either right or wrongContinuous: the error has a magnitude
DEFINITION — Classification

Rigorous definition

A supervised learning problem in which the output space Y is a finite set of classes { c1c_1, ..., ckc_k }. The model generally estimates the conditional probability P(Y = cjc_j | X = x); the predicted class results from applying a decision rule to that probability vector.

In plain terms

Place each observation into one of the categories defined in advance.

Sub-types: binary (2 exclusive classes), multiclass (k exclusive classes), multi-label (k classes that may hold simultaneously), ordinal (k ordered classes, for example a risk grade from A to E).

Point of caution

The classes are defined before training and are part of the specification of the problem. A classification model cannot produce a class it has never seen. If a new class appears in production, no threshold tuning will make the model report it; the specification has to be reopened.

DEFINITION — Regression, and a warning about the word

Rigorous definition

A supervised learning problem in which the output space Y is a subset of the reals. The model estimates a regression function, most often the conditional expectation E[Y | X = x], by minimizing a squared or absolute loss.

In plain terms

Estimate a number rather than a category.

Terminological warning

In modern usage the word "regression" carries no sense of going backward or falling off. It is inherited from Francis Galton's work on the inheritance of human stature (1886), which described a regression toward the mean: the children of unusually tall parents tended, on average, to be less tall than their parents. The word named a particular statistical phenomenon. It was then extended to the fitting method used to demonstrate that phenomenon, and finally to any prediction of a numeric quantity. No inference should therefore be drawn from the word itself: "regression" means only that the target is a number.

A confusion not to make

Logistic regression is a classification algorithm, despite its name. It regresses the log-odds on the explanatory variables and outputs a probability of class membership. It is covered in chapter 036, 036.0-logistic-regression.md.

2.4 Fifteen enterprise use cases

#DomainBusiness problemTypeTarget variable
1BankingConsumer credit approvalBinary classificationDefault within 12 months: yes / no
2BankingCard transaction fraud detectionImbalanced binary classificationFraudulent transaction: yes / no
3BankingLoss given defaultRegressionUnrecovered amount, in dollars
4HealthcareDiagnostic support on medical imagingMulticlass classificationCondition identified among k categories
5HealthcareReadmission riskBinary classificationReadmission within 30 days: yes / no
6Real estateProperty valuationRegressionActual sale price, in dollars
7Human resourcesVoluntary attrition preventionBinary classificationResignation within 6 months: yes / no
8Human resourcesTime-to-hire estimationRegressionDays between posting and signature
9Manufacturing / IoTPredictive maintenanceBinary classificationFailure within 7 days: yes / no
10Manufacturing / IoTRemaining useful life of equipmentRegressionOperating hours before failure
11MarketingChurn predictionBinary classificationCancellation within 90 days: yes / no
12MarketingCustomer lifetime valueRegressionExpected cumulative margin at 24 months, in dollars
13TransportationTravel time estimationRegressionActual duration, in minutes
14CybersecurityPhishing email filteringBinary classificationMalicious email: yes / no
15EnergyGrid load forecastingRegressionConsumption at H+24, in megawatts

How to read the table: in all fifteen cases, historical data carries the answer. The loan was repaid or it was not, the property sold at an observed price, the part failed at a measured hour. It is that retrospective availability of the target that makes the problem supervised — not the intention to predict. Note also that the technical qualification of case 7 says nothing about its lawfulness: non-discrimination obligations are addressed in chapter 095, 095.0-capstone-project.md.

The fourth column repays a second reading. Eight of the fifteen cases are classification and seven are regression, and in every case the split follows from the target type alone. The domain contributes nothing: banking, human resources and manufacturing each appear in both columns, with a classification problem and a regression problem drawn from the same data.

2.5 The worked-exercise analogy

ANALOGY — Learning from worked exercises

A student prepares for an examination using past papers. Each paper comes with its worked solution. The student attempts the question, compares the attempt to the solution, identifies the gap, and adjusts the method. After enough exercises, the student sits an unseen paper whose solution does not yet exist.

Study situationSupervised learningNotation
The question on the paperThe explanatory variables of an observationxix_i
The worked solutionThe label, the known target valueyiy_i
The collection of past papersThe training setS
The student's method of solvingThe learned functionf
The gap between attempt and solutionThe loss on one observationL(f(xix_i), yiy_i)
Revising the methodUpdating the parametersoptimization
The mock examThe validation set
The final exam, unseen paperThe test set, then production
The mark obtained on the final examGeneralization performanceR(f)

Extensions

A student who memorizes the solutions without acquiring the method aces the past papers and fails the unseen one: that is overfitting, covered in chapter 031, 031.0-overfitting-and-underfitting.md. A student who has the solution sheet during the exam obtains an excellent mark that measures nothing: that is data leakage, covered in chapter 028, 028.0-data-leakage.md.

Limits of the analogy

The student understands what they are doing and can transfer the method to a neighboring subject. The model establishes a statistical correspondence only, and does not transfer outside the domain covered by its training data.


3. Unsupervised learning

3.1 Definition

DEFINITION — Unsupervised learning

Rigorous definition

A class of problems in which one is given a sample { x1x_1, ..., xnx_n }, xix_i ∈ X, with no associated target variable. The objective is to estimate a structure of the distribution P(X): a partition of the observation space, a low-dimensional manifold approximating the point cloud, a density, or regularities of co-occurrence. Optimization is carried out on a criterion defined exclusively from the data, with no reference to an expected value.

In plain terms

You supply observations with no answers attached and ask the algorithm to bring out the internal organization of the data.

On the phrase "unsupervised"

It signals the absence of a reference answer, not the absence of human involvement. The choice of variables, of distance, of the number of groups and of the scaling belongs entirely to the analyst.

Point of caution

An unsupervised algorithm always returns a result, including when the data contain no structure whatsoever. Ask a partitioning method for four groups on a perfectly uniform cloud and you will get four groups. The production of a result is therefore never evidence that a structure exists.

3.2 The two major families

The distinction is easy to hold onto: clustering acts on the rows of the table, dimensionality reduction acts on the columns.

DEFINITION — Clustering

Rigorous definition

The problem of building a partition or a covering of a set of observations into groups such that a within-group similarity measure is maximal and a between-group similarity measure is minimal, in the sense of a distance specified by the analyst. An inertia-based partitioning method minimizes the within-group sum of squares:

argmin  Σ      Σ      || x - μ_j ||²
   C   j=1..k  x ∈ C_j

where μj\mu_j denotes the center of group CjC_j.

In plain terms

Group together the observations that resemble one another, without knowing in advance which groups exist or how many there are.

Parameters that belong to the analyst

Number of groups, distance measure, scaling, choice of variables. Each of these changes the result; there is no "true" partition that an algorithm would discover independently of them.

Point of caution

The groups produced have no names. Naming and interpreting them is a business act performed after the algorithm has run — never an output of the algorithm.

DEFINITION — Dimensionality reduction

Rigorous definition

The problem of constructing a map g: X → Z, with dim(Z) < dim(X), that best preserves some property of the original distribution: explained variance for principal component analysis, local neighborhood structure for non-linear embedding methods, reconstruction capacity for autoencoders. The optimized criterion is internal to the data.

In plain terms

Represent the same observations with fewer variables, losing as little information as possible.

Operational purposes: visualization, compression, denoising, preprocessing for a supervised model, mitigation of the curse of dimensionality.

Point of caution

Used upstream of a supervised model, dimensionality reduction must be fitted on the training data alone and then applied unchanged to validation and test data. Fitting it on the full dataset is data leakage, covered in chapter 028, 028.0-data-leakage.md.

3.3 A worked example: segmenting a customer base

A retail chain has 12,000 active customers. No target variable exists: management is not asking for a behavior to be predicted, but for the structure of the base to be understood. Four variables are retained — annual purchase frequency, average basket, tenure, share of purchases made online — and a four-group partitioning is applied after scaling.

Raw output of the algorithm

GroupSizeShareAnnual frequencyAverage basketTenureOnline share
Group 14,32036%1.2 purchases$388 months22%
Group 23,60030%11.4 purchases$425.2 years15%
Group 32,88024%4.1 purchases$1873.4 years71%
Group 41,20010%0.4 purchases$256.1 years5%

The numeric identifiers carry no meaning. "Group 1" says nothing and is not ordered relative to "Group 2". Rerun the algorithm from a different initialization and the same customers may come back as Group 3.

Business interpretation, produced after the algorithm

GroupName given by the businessReadingAction considered
Group 1Recent occasional buyersLow tenure, low engagementActivation journey over the first 6 months
Group 2Neighborhood regularsHigh frequency, low basket, in-store channelLoyalty program, basket growth
Group 3High-basket online buyersBasket four times higher, digital channelPremium offer, dedicated delivery service
Group 4Dormant customersHigh tenure, near-zero activityReactivation campaign, or removal from the active file

The decisive point: the second column was not produced by the algorithm. It was written by business managers examining the statistical profile of each group. A clustering algorithm delimits groups; it does not name them and it does not explain them.

3.4 The absence of ground truth

This is the most important structural difference from supervised learning. Every supervised prediction can be confronted with the observed value: accuracy is measurable. In unsupervised learning there is no reference partition, and the question "is this segmentation correct?" is not well posed. Evaluation then rests on two orders of criteria.

Order of criterionNatureExamplesLimitation
Internal criteriaStatistical, computed on the data aloneSilhouette coefficient, within-cluster inertia, Davies-Bouldin and Calinski-Harabasz indicesA high score is no evidence of business relevance
Business-utility criteriaOperational, judged by domain ownersGroups that are interpretable, actionable, of workable size, stable over timeSubjectivity, dependence on the expertise available

Point of caution: a segmentation with an excellent silhouette coefficient whose groups call for no action is an operational failure; a partition with a mediocre internal score whose groups call for differentiated, measurable actions is a success. The final criterion is usefulness.

Consequence for project management: an unsupervised project cannot be governed by a contractual threshold of the form "at least 90% accuracy". It is governed by an interpretability review conducted with the business. Anyone who writes an accuracy target into the statement of work for a segmentation project has misidentified the paradigm.

3.5 Real applications

DomainApplicationSub-familyOutput used
RetailCustomer base segmentationClusteringHomogeneous groups for differentiated targeting
CommerceMarket basket analysisAssociation rulesProducts frequently bought together
InsuranceTypology of claim profilesClusteringGroups used as a basis for pricing
BioinformaticsGrouping of gene expression profilesClusteringCandidate molecular subtypes
ManufacturingCompression of sensor signalsDimensionality reductionCompact representation for monitoring
DocumentationThematic grouping of a corpusClusteringDocument families with no prior taxonomy
CybersecurityDetection of atypical behaviorAnomaly detectionAlerts for an analyst to qualify
MarketingReducing a survey to its principal axesDimensionality reductionSynthetic attitude factors

A professional observation: unsupervised learning appears more often upstream of a supervised project, as exploration, than as an autonomous production system. A segmentation can itself become an explanatory variable in a later supervised model.


4. Reinforcement learning

4.1 Definition

DEFINITION — Reinforcement learning

Rigorous definition

A learning framework in which an agent interacts sequentially with an environment. At each time step t the agent observes a state sts_t, selects an action ata_t according to a policy π, receives a scalar reward rt+1r_{t+1} and observes a new state st+1s_{t+1}. The problem is most often formalized as a Markov decision process (S, A, P, R, γ), with γ ∈ [0, 1[ the discount factor. The objective is to find a policy π maximizing the expected discounted cumulative return:

J(π) = E[ Σ  γ^t · r_(t+1) ]
          t≥0

Standard reference: Sutton and Barto, Reinforcement Learning: An Introduction (1998, second edition 2018).

In plain terms

The agent does not learn from correct answers supplied in advance but by successive attempts: it acts, the environment penalizes or rewards it, and it adjusts its strategy so as to accumulate as much reward as possible.

What separates a reward from a label

A label states the correct answer, exists before training, and concerns a single isolated observation. A reward evaluates the answer produced, is generated during interaction, bears on a sequence of actions, and depends on the model's own actions.

Point of caution

The delayed character of the reward creates the credit assignment problem: when a reward arrives at the end of hundreds of actions, determining which of them contributed is the central difficulty of the paradigm.

4.2 The agent-environment loop

The cycle repeats until a terminal state, or indefinitely. The structural peculiarity of the paradigm shows up here: the training data are produced by the agent itself. A mediocre policy generates mediocre trajectories, and the agent must nonetheless learn from them. Hence the exploration-exploitation trade-off: a policy that never exploits accumulates no reward, a policy that never explores freezes on a local optimum. That trade-off has no counterpart in supervised learning, where the dataset is fixed.

4.3 Reference vocabulary

TermNotationDefinitionExample: warehouse robot
AgentThe entity that decides and actsThe robot controller
EnvironmentThe system the agent interacts with, producing transitions and rewardsThe warehouse, its racking, its obstacles
Statests_tDescription of the situation at time t, sufficient to decidePosition, load carried, battery level
Actionata_tThe decision taken among those availableMove forward, turn, grip, release
Rewardrt+1r_{t+1}Scalar emitted by the environment, evaluating the transition+10 parcel delivered, -1 per second, -100 collision
Policyπ(a|s)Rule mapping each state to an action or to a distribution over actionsThe learned navigation strategy
EpisodeOne complete trajectory, from an initial state to a terminal stateOne delivery run, from pickup to drop-off
ReturnGtG_tDiscounted sum of rewards from time t onwardTotal value of the run as seen from step t

4.4 Applications

DomainApplicationNature of the rewardMaturity
GamesGo, chess, video gamesWin, scoreDemonstrated, with major academic references
RoboticsLocomotion, grasping, navigationProgress toward the goal, collision penaltyOperational in controlled environments
Data centersCooling controlEnergy saved under a temperature constraintDocumented industrial deployments
FinanceOrder execution, dynamic allocationRisk-adjusted returnReal use, heavily supervised by regulators
AdvertisingSlot allocation, contextual banditsClick, conversionVery widespread, in bandit form
LogisticsScheduling, inventory managementTotal cost, service levelEmerging, generally in simulation

The special case of multi-armed bandits: a simplified form of reinforcement learning with no state transition, deployed at scale for content allocation and adaptive testing. For most organizations it is their only real exposure to this paradigm.

ANALOGY — Acquiring a motor skill

Learning to ride a bicycle does not proceed from a solution sheet. Nobody can supply, for each millisecond, the exact handlebar angle and torso lean. The instruction "keep your balance" is not a label. The available signal is a consequence: the learner stays upright, or falls. And the link between the wrong movement and its consequence is delayed by a few seconds.

Element of the situationFormal counterpart
The learner on the bicycleThe agent
The bicycle, the road, gravityThe environment
Lean, speed, handlebar positionThe state sts_t
Correct the trajectory, pedal, brakeThe action ata_t
Meters covered without falling, a fallThe reward rt+1r_{t+1}
The reflexes acquiredThe policy π
Trying an unusual trajectoryExploration
Repeating what workedExploitation

What the analogy makes visible

The skill is acquired through interaction, not by memorizing question-answer pairs. It cannot be transmitted by a lecture, and acquiring it requires a large number of attempts, unsuccessful ones included. A child falls a few dozen times; an artificial agent commonly needs millions of episodes. When each episode has a material or human cost, training under real conditions becomes impractical — hence the requirement for a simulator.

4.5 Four obstacles to enterprise adoption

Reinforcement learning occupies a large place in the field's public communication and a marginal place in project portfolios. Four obstacles explain the gap.

ObstacleStatementPractical consequenceSituations where it is lifted
1. A simulable environment is requiredLearning demands massive interaction, unacceptable on the real systemYou need a faithful simulator, and building one is a project in its own rightGames, well-modeled physical systems, queueing systems, digital environments
2. Computational costThe number of episodes exceeds the volume of a supervised training run by several orders of magnitudeHigh compute budget, long lead times, slow iterationsLow-dimensional problems, bandits, cheap simulations
3. Reward specificationTurning a business objective into a scalar is hazardous: the agent optimizes exactly what is writtenDegenerate behaviors that maximize the measure without serving the intentObjectives with a direct measure that cannot be gamed
4. Controllability in productionThe policy explores, evolves, and takes sequential decisions that are hard to auditDifficulty in certification, traceability and behavioral guaranteesLow-criticality domains, or setups bounded by external safety rules

Obstacle 3 in detail: degenerate behaviors

A badly specified reward function leads the agent to maximize the measure rather than the objective the measure stands for. The literature calls this reward hacking.

Intended objectiveReward as writtenPossible degenerate behavior
Clean a roomQuantity of dust collectedSpread the dust so it can be collected again
Finish a racePoints accumulated along the courseLoop over a high-point zone without crossing the finish line
Maximize engagementSession durationFavor polarizing content at the expense of satisfaction
Reduce processing timeCases closed per hourClose difficult cases without resolving them
Avoid collisionsPenalty on contactStand still

The agent does not optimize the designer's intent; it optimizes the reward function. Any gap between the two will be exploited. This meets Goodhart's law: when a measure becomes a target, it ceases to be a good measure.

Point of caution on obstacle 4: a supervised model outputs a pointwise prediction that a business process can filter before any action is taken; a reinforcement agent outputs an action policy. The point of human control must therefore be designed explicitly, in the form of safety constraints external to the learning itself.


5. Intermediate paradigms

Signal availability admits intermediate states: partial labels, manufactured labels, labels that exist but are extremely rare. Three configurations follow.

None of these three is a fourth paradigm. Each is a position on the same axis: how much of the target signal you have, and where it came from.

5.1 Semi-supervised learning

DEFINITION — Semi-supervised learning

Rigorous definition

A class of problems in which the sample combines a labeled subset SlS_l = { (xix_i, yiy_i) } of size l and an unlabeled subset SuS_u = { xjx_j } of size u, generally with u >> l. The methods exploit the marginal distribution P(X) estimated on SuS_u to constrain the estimation of P(Y | X) learned on SlS_l, under regularity assumptions: smoothness, cluster, manifold.

In plain terms

You have many observations and few known answers; the unlabeled mass is used to get more out of the small number of labels available.

Point of caution

The regularity assumptions are not always satisfied. When they are not, adding unlabeled data can degrade performance relative to a model trained on the labeled data alone. Semi-supervised learning is not a free improvement; it is a bet on the geometry of the data.

Case study: medical imaging

A hospital holds 200,000 archived scans, of which only 2,000 are annotated. Annotation takes a radiologist several minutes per scan, and annotating the full archive would represent several person-years. A strictly supervised approach discards 99% of the available information; a semi-supervised approach learns the structure of the image space on the 198,000 raw scans and fits the decision rule on the 2,000 annotated ones.

5.2 Self-supervised learning

DEFINITION — Self-supervised learning

Rigorous definition

A class of methods in which the target variable is constructed automatically from the internal structure of the data, with no annotator involved. A so-called pretext task is defined so that its label is deducible from the raw data; the model is trained on that task by ordinary empirical risk minimization, and the resulting representation is then reused for the target task.

In plain terms

The algorithm manufactures its own exercises and its own solution sheets from raw data, which removes the annotation cost.

A decisive clarification

The learning mechanics remain strictly supervised: there is a target value, a loss function, a comparison between prediction and target. Only the provenance of the label changes — extracted from the data instead of supplied by an operator. Self-supervised learning is therefore not a fourth paradigm but a way of obtaining labels.

Point of caution

The quality of the representation depends entirely on the relevance of the pretext task. A task solvable through a superficial artifact yields a representation of no value for the target task.

Case study: masked word prediction

Starting from a raw, unannotated text corpus, training examples are built by masking words and asking the model to restore them.

StepContent
Raw data"The policy rate was raised by twenty-five basis points."
Manufactured example (input)"The policy rate was [MASK] by twenty-five basis points."
Manufactured label (target)"raised"
Annotation costNone: the label is the word removed

This mechanism, popularized by BERT-style architectures (Devlin et al., 2018) and then generalized by autoregressive language models, makes it possible to exploit very large corpora with no human annotation. The resulting representation is subsequently specialized on a supervised task for which few labels exist.

5.3 Anomaly detection

DEFINITION — Anomaly detection

Rigorous definition

The problem of identifying observations whose generation is improbable under the distribution of the observations considered normal. Depending on the availability of labeled anomaly examples, it is formulated as a strongly imbalanced supervised classification, as an unsupervised density or support estimation, or as one-class classification.

In plain terms

Spot what falls outside the ordinary, whether or not you have examples of abnormal cases.

Taxonomic position

Anomaly detection straddles two paradigms. It is not an additional family: it names a business objective that can be addressed within either paradigm depending on the data available.

Data configurationApplicable paradigmUsual methodsEvaluation
A history of confirmed, labeled anomalies, in very low proportionSupervised, under strong imbalanceGradient boosting, random forests with resampling or class weightingRecall, precision, area under the precision-recall curve
No labeled anomalies, or future anomalies distinct from past onesUnsupervisedIsolation Forest, density estimation, one-class SVM, autoencoderInternal criteria, alert rate, expert qualification
A few labeled anomalies and a mass of unqualified observationsSemi-supervisedModel normality, then calibrate the threshold on the labeled casesPrecision on confirmed cases, cost of false positives

A practical decision rule

If the anomalies to be detected resemble those already observed and labeled, the problem is supervised. If the anomalies to be detected are unknown by nature, the problem is unsupervised.

In banking fraud detection, known schemes are handled in a supervised way, with the imbalance techniques covered in chapter 050, 050.0-class-imbalance-understanding.md; new schemes escape by construction a model trained on the past and call for an unsupervised approach. Production systems frequently combine the two.


6. Qualifying a problem

6.1 Decision tree

Reading the "reframe" branch: the absence of labels does not disqualify the project, it moves its first step. The question becomes "how do we build a labeled dataset" — annotation, prospective collection, exploitation of a system log — or "which unsupervised objective are we prepared to accept".

6.2 Comparison of the three paradigms

CriterionSupervisedUnsupervisedReinforcement
LabelsRequired for every training observationNoneNone; replaced by a reward signal
Question asked"What is the value of Y for this observation?""What organization structures these observations?""Which sequence of actions maximizes cumulative return?"
AnalogyLearning from worked exercisesSorting objects with no prior taxonomyAcquiring a motor skill
Accuracy measurementDirect: compare prediction to observed valueImpossible in the strict sense: no ground truthIndirect: cumulative reward over episodes
Sub-typesClassification, regressionClustering, dimensionality reduction, association rulesValue-based methods, policy-based methods, bandits
Typical algorithmsLinear and logistic regression, decision trees, random forests, gradient boosting, SVM, neural networksk-means, hierarchical clustering, DBSCAN, PCA, UMAP, autoencodersQ-learning, SARSA, policy gradients, actor-critic
Frequency in industryDominant: the large majority of models in productionSignificant, mainly in exploration and preparationMarginal outside R&D, with the notable exception of bandits
ExamplePredict whether a customer will cancel within 90 daysSegment the customer base into homogeneous groupsOptimize an inventory management policy in simulation
Coverage in this courseThe central subject, from chapter 004 to the endPositioned here, not developed furtherPositioned here, not developed further

6.3 Telling classification and clustering apart

Both procedures produce groups; the resemblance ends there. Confusing the two is one of the most frequent errors in interviews.

Point of comparisonClassificationClustering
ParadigmSupervisedUnsupervised
Do the groups exist before the analysis?Yes, they are part of the specificationNo, they result from the computation
Number of groupsFixed by the business problemChosen by the analyst, often by exploration
Do the groups have names?Yes, with a business meaning defined a prioriNo, arbitrary identifiers to be interpreted
Data requiredLabeled observationsObservations alone
Question asked"Does this observation belong to class A or class B?""What groups emerge from these observations?"
EvaluationAccuracy, recall, precision, F1, AUCSilhouette, inertia, business utility
Stability of meaningStable: the classes do not changeUnstable: another initialization or another k changes the groups
ExampleAssign an email to "spam" or "legitimate"Discover four profiles in a customer base
Business phrasing that triggers it"We know what we are looking for""We want to know what is there"

A one-question test: does the list of groups appear in the statement of work? If it does, the problem is classification. If it does not, it is clustering.


7. Common reasoning mistakes

MISTAKE — Believing you are doing supervised learning without labels

A marketing team asks for a model predicting "high-potential customers". No variable of that name exists anywhere in the information system. The intention to predict is not enough to create a supervised problem. Two ways out exist, and exactly one must be chosen explicitly: define a target that is measurable and verifiable in the history — for example "revenue over the next 12 months above $5,000" — or accept an exploratory unsupervised approach producing groups to be interpreted.

Correct formulation : "A supervised problem requires a target variable that is defined, measurable and present in the history. Until that variable exists, there is no supervised problem."

MISTAKE — Confusing clustering with classification

Both produce groups, which is enough to sustain the confusion. The discriminating criterion is not the output but the input: do the classes pre-exist in the training data? One consequence shows up regularly in practice: a clustering presented as a predictive model, complete with a claimed accuracy figure — a figure that is meaningless in the absence of a reference partition.

Correct formulation : "Classification assigns an observation to classes defined beforehand and learned from labeled examples; clustering forms groups from similarities alone, with no pre-existing classes and no measurable accuracy."

MISTAKE — Treating unsupervised learning as the easier option

The absence of labels lightens data collection and gives the impression of a less demanding problem. On validation, the opposite is true: with no ground truth, the project has no objective stopping criterion, and the number of groups, the distance and the scaling are choices that no metric settles. A supervised project ends with a performance figure on a test set; an unsupervised project ends with a business acceptance decision.

Correct formulation : "Unsupervised learning is less demanding in labeled data and more demanding in interpretation: its difficulty moves from collection to validation."

MISTAKE — Treating Deep Learning as a fourth paradigm

The list "supervised, unsupervised, reinforcement, Deep Learning" mixes two planes of classification. The first three terms name paradigms, defined by the nature of the learning signal; the fourth names a class of models, defined by an architecture. A neural network trained on labeled images is supervised; an autoencoder is unsupervised; a network optimizing a policy from rewards is reinforcement.

Correct formulation : "Deep Learning is a class of models usable within all three paradigms; it sits on a different plane of classification."

MISTAKE — Using as a label a variable that postdates the moment of prediction

To predict churn at 90 days, a team retains as an explanatory variable the number of calls to the cancellation desk. Performance is excellent in validation and worthless in production: at the moment the prediction has to be issued, that call has not yet taken place. The variable is not predictive of the event, it is constitutive of it. This form of data leakage, covered in chapter 028, 028.0-data-leakage.md, is not detectable through metrics — it improves them.

Control rule : for every explanatory variable, verify that its value would genuinely be available at the instant the model is queried in production.

Correct formulation : "The label postdates the explanatory variables; any information contemporaneous with or subsequent to the realization of the target must be excluded from the training set."

MISTAKE — Inferring the paradigm from the application domain

"Healthcare is supervised" and "marketing is clustering" are statements with no foundation. Healthcare gives rise to readmission prediction (supervised), to the identification of patient subgroups (unsupervised) and to sequential adaptation of a dosing protocol (reinforcement). Marketing gives rise to churn prediction, to segmentation, and to dynamic offer allocation through bandits.

Correct formulation : "The paradigm is determined by the nature of the available learning signal, never by the industry sector."


8. Summary

THE SINGLE CRITERION
    "For past observations, do we have the value
      we are trying to predict?"

    Yes ..................................... SUPERVISED
    No ...................................... UNSUPERVISED
    No, but a delayed evaluation
    of actions is available ................. REINFORCEMENT

SUB-FAMILIES
    Supervised     : classification (categorical target)
                     regression     (numeric target)
    Unsupervised   : clustering, dimensionality reduction,
                     association rules
    Reinforcement  : value-based or policy-based methods

INTERMEDIATE CONFIGURATIONS
    Semi-supervised : only a fraction of the observations is labeled
    Self-supervised : labels manufactured from the data;
                      the mechanics remain supervised
    Anomalies       : supervised if past anomalies are labeled,
                      unsupervised if they are unknown by nature

WHAT IS NOT A CLASSIFYING CRITERION
    the domain, the data type, the volume,
    the model architecture, the stated business goal

A DISTINCTION NEVER TO LOSE
    Classification : the groups exist before the analysis
    Clustering     : the groups result from the analysis

WHAT EACH PARADIGM MEASURES
    Supervised     : an accuracy, against the observed value
    Unsupervised   : an internal cohesion and a business utility
    Reinforcement  : a cumulative reward over episodes

WHERE DEEP LEARNING SITS
    A class of models usable within all three paradigms.
    It is not a fourth paradigm.

Summary statement

Learning paradigms are distinguished by the nature of the available signal and by nothing else: a known target value, observation by observation, defines supervised learning; the internal structure of the data alone defines unsupervised learning; a delayed reward emitted by an environment defines reinforcement learning. The domain, the volume and the model architecture have no bearing on this classification.


Associated quizzes : 003.1-quiz-classifying-criterion.md, 003.2-quiz-supervised-learning.md, 003.3-quiz-unsupervised-learning.md, 003.4-quiz-reinforcement-learning.md, 003.5-quiz-intermediate-paradigms.md, 003.6-quiz-problem-qualification.md

Next chapter : 004.0-supervised-learning-formalization.md