Neuron 101

Classification / Confusion matrix and metrics

Türkçe

Plate41

Unit 4 · Topic 9 of 10

Confusion matrix and metrics

Medium, 8 min, 10 steps

81216202428323600.250.500.751temperature, degreeschance of selling out
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 10 Model

The model and the days

The curve learned by logistic regression and the 16 days. The red circles at the top are days when the ice cream really sold out, the blue squares at the bottom days when it did not.

Open in Colab
  1. def matris(p, s, esik):
  2. dp = yp = yn = dn = 0
  3. for q, c in zip(p, s):
  4. t = q >= esik
  5. if t and c == 1: dp += 1
  6. elif t: yp += 1
  7. elif c == 1: yn += 1
  8. else: dn += 1
  9. return dp, yp, yn, dn
  10. dp, yp, yn, dn = matris(p, s, 0.5)
  11. kesinlik = dp / (dp + yp)
  12. duyarlilik = dp / (dp + yn)
esik
0.50
dp
7
yp
1
yn
1
dn
7