Artificial Intelligence and Machine Learning · Lecture 11 of 16

Classification · Part 1

Class probabilities and logistic model fitting

Use class probabilities to make decisions, then see how maximum likelihood fits a logistic model.

01Class probabilities and decision errors
02Naive Bayes and its assumptions
03Logistic regression and maximum likelihood
5.1 · A classification problem

Classification means predicting a category

We use categories every day. Can a model learn to assign them? Start with a hospital task.

Input

x

Cholesterol measurement

Classifier

f

Learns from labelled patients

Predicted class

y^∈𝒴={0,1}

0 Absent
1 Present

A numerical input can have a categorical outcome.
Two classes make this a binary classification problem.
x = observed inputf = classifierŷ = predicted label𝒴 = set of possible classes
5.1 · A classification problem

Our hospital data: two classes, 0 and 1

Each dot is one patient. Inspect a point, then compare the two classes and their sharp transition.

5.1 · From the observations to a model

Why not fit a line or polynomial?

Polynomial degrees
Fit the same 100 patients with different polynomial degrees.
Ordinary regression can leave the range [0,1], so its outputs are not automatically valid class probabilities.
Lecture map

From a label to a probability model

ChapterQuestion we will answer
5.1 · A classification problemWhat changes when the target is a category?
5.2 · Probabilistic interpretation of machine learningWhy predict probabilities rather than certainty?
5.3 · Optimal Bayes classifierWhich decision minimizes the chance of an error?
5.4–5.5 · Naive Bayes / Estimating distributionsHow can we estimate class probabilities from data?
5.6 · Logistic regressionCan we model a class probability directly?
5.6.1 · Maximum likelihood estimationWhich logistic coefficients make the observed labels most likely?
5.1 · A classification problem

Read a dataset: rows are patients, columns are features

𝒟={(xi,yi)}i=1n,yi∈𝒴={0,1}
Patient iFeature 1: cholesterolFeature 2: ageObserved class
1x₁₁ = 0.55x₁₂ = 50y₁ = 1
2x₂₁ = 0.20x₂₂ = 34y₂ = 0
xi=(xi1,…,xij,…,xim),j=1,…,my^i=f(xi)
𝒟 = dataset, with n observationsi = row (patient), from 1 to nj = feature column, from 1 to mm = number of input featuresxᵢⱼ = feature j for patient iyᵢ = observed label, ŷᵢ = predicted labelxᵢ = input vector for patient if = classifier𝒴 = {0,1}, the set of class labelsCholesterol alone gives m = 1. Using cholesterol and age as inputs gives m = 2.The table is illustrative. Cholesterol uses the teaching scale, not clinical units.
5.2 · Probabilistic interpretation of machine learning

From regression’s random error to class uncertainty

Before observing(X,Y)(xi,yi)One recorded sample

Regression: add a random error

f(xi)+ϵi=yi
Model value5
+
Random error−1
=
Observation4

Classification: give each label a probability

Each possible label receives a probability.

0: 30%1: 70%
We do not add a numerical ε to a class label.
We describe the uncertainty through the probabilities of the possible classes.
X,Y = random input and outcomexᵢ,yᵢ = values recorded for case if(xᵢ) = regression relationshipεᵢ = random deviation from f(xᵢ)0,1 = the two possible class labelsThe two descriptions model uncertainty. εᵢ is not itself a class probability.
5.2 · Probabilistic interpretation of machine learning

The same recorded input can have different labels

CaseRecorded cholesterolObserved disease label
Patient ixᵢ = 0.50yᵢ = 0 (absent)
Patient jxⱼ = 0.50yⱼ = 1 (present)
xi=xjbutyi≠yj
Missing informationAge, history, measurement noise
Ambiguous labelsThe same cloth: “blue” or “green”?
Think of a die: without the details of the throw and surface, we use probabilities.
Probability describes what our available information leaves uncertain.
i,j = two different casesxᵢ,xⱼ = recorded inputsyᵢ,yⱼ = observed labels
5.2 · Probabilistic interpretation of machine learning

Two types of uncertainty

Epistemic:

Uncertainty in the measurements that can be controlled, to a certain extent.

Better measurement precision reduces uncertaintyLess precise toolMore precise toolReference value
More precise tools give a narrower spread of readings.

Better tools or additional predictors can decrease epistemic uncertainty.

Aleatoric:

Uncertainty intrinsic in the process that cannot be controlled and therefore not decreased.

Fair die: six equally likely outcomes123456
Fair-die model: each outcome has probability 1/6.

We can know these probabilities and still be uncertain about the next outcome.

The distinction depends on the context and on what we measure.
5.2 · Probabilistic interpretation of machine learning

Some data occur more often than others

Suppose we record people’s hair colour during data collection. In this varied illustrative sample, we observe more people with black hair than with red hair.

Illustrative hair-colour frequencies in a sample of twenty peopleBlack12/20 = 60%Brown5/20 = 25%Red3/20 = 15%
Some values occur more often than others.
A probability model should reflect these different frequencies when we analyse the data.
Illustrative sample of 20 peopleRelative frequency = count / sample sizeThe three relative frequencies sum to 100%.
5.2.1 · In classification problems

Conditional probability: how likely is this label for this input?

ℙ(Y=yi∣X=xi)=p(yi∣xi)

Read: “The probability that the outcome is yᵢ, given input xᵢ.” Both expressions give that same probability.

Known input: condition on this value

X=xi=0.50

Hypothetical patient input

Possible outcomes under that condition

0: 30%1: 70%
p(0∣xi)=0.30,p(1∣xi)=0.70

Illustrative probabilities for this same input.

Lowercase p names the conditional probability mass function (PMF) of Y given X.
Because Y has discrete class labels, this function assigns a probability to each possible class.
For example, p(1 | 0.50) = 0.70. The event notation ℙ(Y=1 | X=0.50) gives the same probability.
ℙ = probability operator, applied to an eventp(yᵢ | xᵢ) = the PMF evaluated at these valuesX,Y = random input and outcomexᵢ,yᵢ = recorded values for case i𝒴 = {0,1}, the class setPMF values sum to 1 at each input.
5.2.1 · Why use class probabilities?

Why predict probabilities before choosing a class?

1. A smoother learning signal

0.60 ⟶ 0.80

Probabilities change continuously. Often, optimizing them is simpler than optimizing discrete class labels.

If the observed class is 1, 0.60 to 0.80 strengthens the prediction while its label stays 1.

2. A measure of model confidence

Model confidence: concentrated and evenly spread probabilitiesConfident predictionClass 0: 5% Class 1: 95%Uncertain prediction
Second bar: class 0 = 50%, class 1 = 50%.
Concentrated probabilities express more confidence. Similar probabilities express less.
A confident prediction can still be wrong.
5.3 · Optimal Bayes classifier

If we knew the true probabilities, which label should we choose?

The Optimal Bayes Classifier (OBC) chooses the most probable class. It is a theoretical benchmark: in practice we usually have to estimate those probabilities.

y^i=f(xi)={1if ℙ(Y=1∣X=xi)≥0.50otherwise

Example: 70% present, 30% absent

Choose class 1.
It is the label with the higher chance of being right.

What does “optimal” mean here?

The lowest expected fraction of wrong labels, using these features and treating every mistake as equally costly.

𝒴 = {0,1}, the class setxᵢ = input for observation iŷᵢ = predicted labelf = Optimal Bayes ClassifierAt exactly 50%, either label has the same expected error. This rule chooses 1.
5.3 · More than two classes

With several classes, choose the one with greatest probability

𝒴={1,…,C},y^i=argmaxc∈𝒴ℙ(Y=c∣X=xi)
Candidate class c123
True probability at this input0.100.700.20

argmax returns the winning class

The prediction is ŷᵢ = 2.
The largest probability is 0.70, but our output is the class label 2.

Why ŷᵢ can differ from yᵢ

Binary example: p(1 | xᵢ) = 0.4.
The OBC predicts 0, but the observed label can still be 1, with probability 0.4.

This 0/1 outcome is called a Bernoulli outcome.

Y = random class variable, taking one label from 𝒴𝒴 = {1,…,C}, the set of all possible class labelsC = number of classesc = a candidate label from 𝒴i = observation indexThe numbers 1,…,C are category codes. They do not describe distances or severity.
5.3 · Measuring classification mistakes

The error rate is the probability that our label is wrong

Even the most likely class can be wrong. To compare classifiers, we average their mistakes over possible inputs and outcomes.

R(f)=𝔼XY[𝟙(Y≠f(X))]

𝟙 is called an indicator function

𝟙(Y≠f(X))={1wrong label0correct label

The expectation averages those 0s and 1s

Toy population: 10 equally likely cases

R(f)=3 wrong10 cases=0.30

0 = correct label1 = wrong label

R(f) is called risk or expected classification error. It lies between 0 and 1.
We will show that the Bayes rule gives the smallest possible R(f) for these features.
f = any classifierf(X) = predicted labelY = outcomeX = input𝟙(…) = 1 when the condition is true, otherwise 0𝔼ₓᵧ = average over X and Y
5.3 · Why the optimal Bayes classifier works

Which class gives the smaller chance of a mistake?

Reminder: the OBC chooses the class with the highest true probability. The individual case’s label is still unknown.

Return to two classes, {0,1}. Hold one input x fixed and compare the two possible predictions.

p(x)=p(1∣x)=ℙ(Y=1∣X=x)

Here p(x) always means the probability of class 1. The class 1 is understood in this shorter notation.

Example at this input: suppose p(x) = 0.70.

If we predict 0

We make a mistake when the actual class is 1.

Error probability=p(x)=0.70

If we predict 1

We make a mistake when the actual class is 0.

Error probability=1−p(x)=0.30
The OBC therefore predicts class 1 here.
Its chance of a mistake is 30%, the smaller of the two.
y^=argmaxc∈𝒴 ℙ(Y=c∣X=x)
X = random input, x = one fixed input valueY = actual class, 𝒴 = {0,1} = possible class labelsŷ = predicted label, c = candidate class from 𝒴p(X) = the same class-1 probability function evaluated at the random input X
5.3 · Interactive derivation

Why does the Bayes rule minimize the error rate?

We prove the two-class case. Let p(X)=ℙ(Y=1∣X).

01 · Start from the error rate

R(f)=𝔼XY[𝟙(Y≠f(X))]

02 · Average in two stages

=𝔼X[𝔼Y∣X[𝟙(Y≠f(X))]]

03 · Write the two possible mistakes

=𝔼X[p(X)𝟙(f(X)=0)+(1−p(X))𝟙(f(X)=1)]

04 · Choose the smaller error at each input

p(x)𝟙(f(x)=0)+(1−p(x))𝟙(f(x)=1)

05 · Recover the Optimal Bayes Classifier

f(x)={1if 1−p(x)≤p(x)0otherwise={1if p(x)≥0.50otherwise
p(X) = probability that Y = 1 given Xf = the classifier being chosenR(f) = expected classification error𝔼 = average over the indicated variables𝔼ᵧ|ₓ = average over labels with input fixed𝟙(A) = 1 if A is true, otherwise 0X,Y = random input and outcomex = one particular input value
5.3 · Limits of prediction

Optimal does not mean error-free

Expected class proportions among 100 comparable cases100 comparable cases at the same observed inputClass 1: 70 expectedClass 0: 30 expected
For 100 comparable cases with p(x) = 0.7, always predicting 1 gives about 30 mistakes on average.
Without additional information, no decision rule can improve that expected error.
p(x) = ℙ(Y=1 | X=x)The 100 cases illustrate expected proportions, not an exact guarantee.
5.3.1 · Evaluation

Accuracy: what fraction of labels did we get right?

Acc(𝐗,𝐘)=1n∑i=1n𝟙(yi=y^i)

One indicator for each case

True labels: 0, 1, 1, 0
Predictions: 0, 1, 0, 0
Indicators: 1, 1, 0, 1

Average the correct predictions

Acc=1+1+0+14=0.75

Three of four predictions are correct: 75%.

Accuracy lies in [0,1].
0 means no correct predictions. 1 means all predictions are correct.
𝐗,𝐘 = evaluated inputs and observed labelsn = number of evaluated casesyᵢ = observed label, ŷᵢ = predicted label𝟙(A) = 1 if A is true, otherwise 0
5.4 · Naive Bayes classifier

Naive Bayes Classifier: using Bayes’ theorem

Weather example: the posterior is ℙ(rain∣cloudy), the probability of rain given a cloudy sky.

posterior=likelihood×priorevidence
pY∣X(y∣x)=pX∣Y(x∣y)pY(y)pX(x)

Likelihood: pX∣Y(x | y)

How are these features distributed within class y?

ℙ(cloudy∣rain)

How often is it cloudy when it rains?

Prior: pY(y)

How common is class y before seeing this input?

ℙ(rain)

How common is rain before considering clouds?

Evidence: pX(x)

How common is this input overall?
It normalizes the posterior.

ℙ(cloudy)

Cloudy days among all days, rainy or dry.

pY∣X(y | x) = posterior class probabilityX = input (cloud condition), Y = class (rain status)Example values: x = cloudy, y = rainSubscripts say which variables the distribution describes.Because Y is discrete: pY∣X(y | x) = ℙ(Y=y | X=x).For continuous X, pX and pX∣Y are densities.
5.4 · Naive Bayes classifier

A common clue is not the same as a likely class

100 emailsContain the word “offer”Do not contain it
10 spam82
90 ordinary1872

Read down the clue column

26 emails contain “offer”.
Only 8 of those are spam.

ℙ(spam∣offer)=826≈0.31

The same calculation with Bayes

Likelihoods: read within each class

ℙ(offer∣spam)=8/10=0.8
ℙ(offer∣ordinary)=18/90=0.2

Priors: read the class totals

ℙ(spam)=10/100=0.1
ℙ(ordinary)=90/100=0.9

Evidence: “offer” occurs in 8 + 18 = 26 of all 100 emails, so ℙ(offer)=26/100=0.26.

0.8×0.10.8×0.1+0.2×0.9=0.080.26≈0.31
80% of spam contains the clue.
That does not mean 80% of emails containing the clue are spam.
5.5 · Estimating the distributions

The “naive” assumption makes the likelihood simpler

Let x=(x1,…,xm). We leave out the observation index i to focus on one input.

pX∣Y(x∣c)=pX∣Y(x1,…,xm∣c)=pX1∣Y(x1∣c)⋯pXm∣Y(xm∣c)=∏j=1mpXj∣Y(xj∣c)
Assume the predictors are conditionally independent given the class.
Under this assumption, model each feature separately within class c, then multiply. These are easier, one-variable distributions.
Xⱼ = random variable for feature jxⱼ = its value in this inputm = number of featuresj = feature index, from 1 to mc ∈ 𝒴 = a candidate class∏ = multiply one term per feature
5.5 · Estimating the distributions

Estimate the prior by counting the class examples

pY(c)=ncn

Count the class

n꜀ is the number of training observations with label c.
n is the total number of training observations.

Turn the count into a proportion

Example: 10 spam emails out of 100 emails.

pY(spam)=10100=0.10
The prior describes how common a class is before we use this particular input.
Here pY(c) is estimated from the training data.
Y = random class variablec ∈ 𝒴 = the class being countedn꜀ = number of class-c training casesn = total training cases
5.5 · Estimating the distributions

Prediction: choose the class with the largest posterior

y^=argmaxc∈𝒴 pY∣X(c∣x)=argmaxc∈𝒴 pX∣Y(x∣c)pY(c)pX(x)

First line: compare the classes

For this fixed input x, evaluate each candidate class c.
argmax returns the winning class label.

Second line: use Bayes’ theorem

Replace each posterior with likelihood × prior / evidence.
The input x stays fixed while c changes.

Do we have to calculate the evidence pX(x)?
The next derivation shows why it does not affect which class wins.
ŷ = predicted classc ∈ 𝒴 = candidate class in the class setx = the input being classifiedpY∣X, pX∣Y, pY, pX = posterior, likelihood, prior, evidence
5.5 · Estimating the distributions

Why can we use log scores and omit the evidence?

01 · Start from the Bayes decision

y^=argmaxc∈𝒴 pX∣Y(x∣c)pY(c)pX(x)

02 · Apply a logarithm

y^=argmaxc∈𝒴 log(pX∣Y(x∣c)pY(c)pX(x))

03 · Expand the logarithm

y^=argmaxc∈𝒴 [log(pX∣Y(x∣c))+log(pY(c))−log(pX(x))]

04 · Remove the common evidence

y^=argmaxc∈𝒴 [log(pX∣Y(x∣c))+log(pY(c))]

05 · Use the feature factorization

y^=argmaxc∈𝒴 [∑j=1mlog(pXj∣Y(xj∣c))+log(pY(c))]
log = natural logarithm, applied to positive scoresargmax = return the class that gives the largest scorex = fixed input, c ∈ 𝒴 = candidate classj = feature index, m = number of featurespX∣Y = likelihood, pY = prior, pX = evidence
5.5.1 · Estimating the feature distributions

How do we estimate each feature distribution?

We still need pXj∣Y(xj∣y), the likelihood of the observed value of feature j within class y. To estimate it, group the training values by class first.

Type of feature xⱼMethodIntuition
QuantitativeParametric, such as a GaussianChoose a shape and estimate its parameters.
QuantitativeNonparametric, such as kernel density estimation (KDE)Estimate a smooth density from the observed values.
CategoricalClass-conditional proportionsCount how often each category occurs within each class.
Xⱼ = random variable for feature jxⱼ = observed value of feature jy = a fixed class, also denoted c when comparing classesParametric = choose a family with parametersNonparametric = estimate without choosing that fixed family
5.5.1 · Estimating a feature likelihood

From labeled measurements to a Gaussian likelihood

Fitting and reading two petal-length densities Density (per cm) 0 0.2 0.4 1 2 3 4 5 6 7 8 9 Petal length (cm) New flower: 5.6 cm 0.111 Species 0 0.368 Species 1 Labeled training lengths

1. Group the training measurements by species

Species 0: 2.5, 3.5, 4, 4.5, 5.5 cm
Species 1: 4.5, 5.5, 6, 6.5, 7.5 cm

2. Fit one bell curve to each group

The average sets the center (4 or 6 cm). Average the squared distances from that center to estimate the variance (1 cm² in both groups here).

3. Read both curves at the new value

At 5.6 cm, each curve’s height gives pXj∣Y(xj∣c) for that species. Bayes’ rule combines these densities with the other features’ densities and the class prior.

Model for one class Xj∣Y=c∼𝒩(μj,σj2) j = feature index, c = species being evaluated 𝒩 = Gaussian (normal) distribution μⱼ = mean and σⱼ² = variance, estimated within species c
5.5.1 · Try Naive Bayes

Naive Bayes: classify one flower

One new flower has petal length x₁ and width x₂, measured in cm. Change its measurements and predict species 0 or 1.

5.6 · Logistic regression

Can we predict the class probability directly?

Naive Bayes

First model the feature values within each class.

Estimate how the features are distributed for each class c and how common that class is (its prior).

Then use Bayes’ theorem to compute the probability of class c for the observed input xᵢ:

pY∣X(c∣xi)=pX∣Y(xi∣c)pY(c)pX(xi)

This combines the feature likelihood, class prior and evidence.

Logistic regression

Model the probability of a class directly from the feature values.

For input xᵢ, calculate a weighted sum of its features: a linear score.

An S-shaped logistic function converts that score into a probability between 0 and 1:

ℙ(Y=1∣X=xi)=σ(xi)

The coefficients are learned from labelled examples. The next slide gives the formula for σ(xᵢ).

X = input features, xᵢ = their values for observation iY = class variable, c = a candidate class labelσ(xᵢ) = logistic model’s probability of class 1p = probability or density function identified by its subscript
5.6 · Logistic regression

Logistic regression turns a linear score into a probability

ℙ(Y=1∣X=xi)=σ(xi)=11+e−(∑j=0mβjxij)=e∑j=0mβjxij1+e∑j=0mβjxij

Inside: a familiar linear score

∑j=0mβjxij=β0+∑j=1mβjxij

Set xᵢ₀=1 to include the intercept β₀.

Outside: the sigmoid

σ(xᵢ) is the model’s class-1 probability.
The exponential keeps it between 0 and 1.
The class-0 probability is 1−σ(xᵢ).

The two fractions are equal: multiply the first numerator and denominator by e∑j=0mβjxij.
i = observation indexj = feature index, m = number of featuresxᵢⱼ = feature j for observation iβⱼ = learnable coefficient, β₀ = intercepte ≈ 2.718 = exponential baseσ(xᵢ) = logistic function evaluated using input xᵢ
5.6 · Read the sigmoid

The score tells us which side of 50% we are on

Sigmoid: a linear score becomes a probability0.119-20.50000.8812Score z10
Read the score
Negative: class 1 probability below 0.5.
Zero: probability 0.5.
Positive: class 1 probability above 0.5.
What happens to the regression form?
The score is linear in β. The probability is nonlinear because β is inside the exponential.
No ε is added to a label. The class probabilities describe the uncertainty.
z=∑j=0mβjxij = linear score on the horizontal axisσ(xᵢ) = modelled class-1 probability on the vertical axisAt z=0, σ(xᵢ)=0.5.
5.6 · Logistic regression

From a logistic probability to a class label

y^i={1if σ(xi)≥0.50otherwise

Probability first

Example: σ(xᵢ)=0.70.
The model assigns 70% to class 1 and 30% to class 0.

Then choose the more probable class

Since 0.70≥0.5, predict ŷᵢ=1.
If σ(xᵢ)=0.30 instead, predict ŷᵢ=0.

The output σ(xᵢ) is a probability.
The prediction ŷᵢ is a class label, either 0 or 1.
xᵢ = input for observation iσ(xᵢ) = modelled class-1 probabilityŷᵢ = predicted label𝒴={0,1} = binary class set
5.6 · Try logistic predictions

Try the sigmoid: change the score, then read the label

Move the midpoint and slope to change the curve. Compare the class-1 probability with the fixed 0.5 cutoff and read the resulting accuracy.

5.6.1 · Maximum likelihood estimation

A good probability model makes the observed labels plausible

Why multiply? We want the probability of both recorded labels occurring together. Given the inputs, the model treats the two patients’ labels as independent, so it multiplies the probability it assigns to each recorded label (slide 25).

Two fixed labels: y₁ = 1, y₂ = 0Model AModel B
Model’s class-1 probabilities(0.9, 0.9)(0.6, 0.4)
Patient 1 has label 1: use σ(x₁)0.90.6
Patient 2 has label 0: use 1−σ(x₂)1−0.9 = 0.11−0.4 = 0.6
Joint likelihood: σ(x₁) × (1 − σ(x₂))0.9 × 0.1 = 0.090.6 × 0.6 = 0.36
Model B assigns four times the likelihood to the observed pair (0.36 / 0.09).
Model A gives only 0.10 to patient 2’s recorded label.
5.6.1 · Maximum likelihood estimation

Choose coefficients that make the observed labels likely

𝛃^=argmax𝛃∈ℝm+1 ∏i:yi=1σ(xi)∏i′:yi′=0(1−σ(xi′))

If the recorded label is 1

Use the factor σ(xi)

This is the probability assigned to what actually happened.

Example: σ(xᵢ)=0.8 gives a factor of 0.8. Increasing it toward 1 makes the observed label more likely.

If the recorded label is 0

Use the factor 1−σ(xi′)

Use the probability of class 0, because that is what happened.

Example: σ(xᵢ′)=0.2 gives 1−0.2=0.8. Moving σ(xᵢ′) toward 0 increases this factor.

The same coefficients determine every probability in the product.
Maximum Likelihood Estimation (MLE) chooses the coefficients with the largest joint likelihood. argmax returns those coefficients, rather than the product value.
𝛃=(β₀,…,βₘ) = coefficients, β₀ is the intercept𝛃^ = the fitted coefficient vectorm = number of features
ℝm+1 = m feature coefficients + 1 intercept
∏ = multiply all indicated observationsi,i′ = observation indices, yᵢ,yᵢ′ = their observed labelsσ(x) = class-1 probability for candidate 𝛃
5.6.1 · Maximum likelihood estimation

How do we find those coefficients?

1. Try coefficients

Start with a candidate 𝛃.
Use the logistic formula to compute σ(xᵢ) for every training input.

2. Calculate the likelihood

For each label 1 use σ(xᵢ).
For each label 0 use 1−σ(xᵢ).
Multiply those contributions.

3. Improve the candidate

A numerical optimizer adjusts the coefficients to seek a larger likelihood.
Repeat until its stopping criterion is met.

This problem has no closed-form coefficient formula like ordinary least squares.
We use numerical optimization: improve candidate coefficients through calculations.
𝛃 = coefficients currently being triedσ(xᵢ) = probability computed from those coefficients𝛃^ = resulting fitted coefficientsNumerical optimization = repeated calculations to improve candidate coefficients
5.6.1 · Maximum likelihood estimation

Try coefficients and read the likelihood

The inputs and labels stay fixed. Select a patient, read the probability assigned to their observed label, then see how all 100 contributions combine.

Before you leave

From observed categories to probability-based predictions

Explain without symbols

Choose a worked example and describe what each step achieves.

Connect the symbols

Name every quantity in the corresponding formula, then explain why the formula does that job.

Explain the conditional probabilities, the Bayes decision rule and its derivation.
Then explain how Naive Bayes and logistic regression obtain class probabilities and how maximum likelihood fits the logistic coefficients.
Further reading
Continue learning
AIML · Lecture 11 · Classification · Part 1
Course home