1. 程式人生 > >機器學習之Coursera Andrew Ng 《Machine Learning》 week 6 test 2

機器學習之Coursera Andrew Ng 《Machine Learning》 week 6 test 2

本系列文章是coursera上Andrew Ng的《Machine Learning》的測驗題,每次測驗都會有不同的錯,記錄下來,不定時的補充。錯的題目希望能幫我改正一下,我改錯的也希望大家能提出。

1、


Accuarcy = (85 + 10) / 1000 = 0.095 Precision = 85 / (85 + 890) = 0.087 Recall = 85 / (85 + 15) = 0.85 F1 score = 2 * (P * R) / (P + R) = 0.158
2、 (1)right
(2)right
3、 (1)right
(2)right
4、 (1)right

always predict spam(y=1):

Actual 1 Actual 0
Predict 1 1 99
Predict 0 0 0

P = 1%;   R = 100%

always predict non-spam(y=0):

Actual 1 Acual 0
Predict 1 0 0
Predict 0 1 99
R = 0%;  Accuracy = 99%;

(2)wrong
5、 (1)wrong
(2)wrong