Precision-Recall

Question 1

Screenshot taken from Coursera

Answer

Recall = 5600 /(5600 + 40) = 0.99

Question 2

Screenshot taken from Coursera

Answer

Accuracy = (5600 + 2460)/(5600 + 2460 + 40 + 1900) = 0.8

Question 3

Screenshot taken from Coursera

Question 4

Screenshot taken from Coursera

Answer

  • Precision: 5600/float(5600 + 1900)= 0.75
  • Recall = 5600 /(5600 + 40) = 0.99

Question 5

Screenshot taken from Coursera

Question 6

Screenshot taken from Coursera

Question 7

Screenshot taken from Coursera

Question 8

Screenshot taken from Coursera

Question 9

Screenshot taken from Coursera

Answer

  • Notice that class probability =/= score. In the context of linear classifier, score is the dot product of coefficieints and features.

  • Recall that P(y = +1 | x,w) = sigmoid(score). If we want P(y=+1|x,w) to be greater than 0.9, how large should the score be?

$\large \frac{1}{1 + e^{-score}} = 0.9$

$=> \large 0.9 + 0.9 e^{-score} = 1$

$=>\large \frac{0.1}{0.9} = e^{-score}$

$=>\large \ln(\frac{0.1}{0.9}) = \ln(e^{-score})$

$=>\large score = 2.20$