StudyBrixFree worksheets, study guides and courses

Artificial intelligence · lesson 3 of 4

Logistic scores, thresholds and confusion matrices

A logistic model maps a real score through σ(z)=1/(1+exp(−z)). Interpreting a score as a reliable probability requires calibration assessment.

University8 practice questionsNotes + worked examples

Learn the ideas

Prerequisites: Probability, ratios and model evaluation.

Score

A logistic model maps a real score through σ(z)=1/(1+exp(−z)). Interpreting a score as a reliable probability requires calibration assessment.

Threshold

A binary decision compares a score with a stated threshold. Changing the threshold can trade false positives against false negatives.

Metrics

Precision is TP/(TP+FP); recall is TP/(TP+FN). A zero denominator requires explicit handling rather than silent division.

F1

F1=2TP/(2TP+FP+FN) where defined. It summarizes a tradeoff but does not incorporate every application-specific cost.

Worked examples

Example 1

Find σ(0) for the logistic sigmoid.

1/(1+exp(0))=1/2.

0.5

Example 2

With TP=12 and FP=3, find precision.

12/(12+3)=0.8.

0.8

Check your understanding

8 questions

Decimals or fractions are accepted for numeric answers. Proofs and written responses use sample answers and require human marking. This is practice, not a protected examination.

1 Find σ(0) for the logistic sigmoid.

Show answer and explanation

0.5

1/(1+exp(0))=1/2.

2 With TP=12 and FP=3, find precision.

Show answer and explanation

0.8

12/(12+3)=0.8.

3 With TP=12 and FN=8, find recall.

Show answer and explanation

0.6

12/(12+8)=0.6.

4 What is a false positive?

Show answer and explanation

Predicted positive but actually negative

The predicted class is positive and the true class is negative.

5 For TP=6, FP=2, FN=4, find F1.

Show answer and explanation

2/3

F1=12/(12+2+4)=12/18.

6 Why can lowering a threshold increase recall while reducing precision?

Sample answer and marking guidance

More examples are labelled positive, potentially capturing missed positives while also admitting more false positives. The exact change depends on the data.

Credit both effects without claiming strict monotonic precision in every finite set.

7 Should a metric with zero denominator be silently reported as an ordinary exact value?

Show answer and explanation

No; use an explicit convention and disclose it

Undefined cases need an explicit evaluation convention.

8 Why should a threshold be selected using validation rather than repeated final-test tuning?

Sample answer and marking guidance

Threshold selection is model selection. Using test outcomes for it contaminates the independent evaluation.

Credit selection and leakage.

Further reading and review references

These are reference links, not copied exercises, institutional endorsement or proof of independent review.