1 回答

TA貢獻(xiàn)1936條經(jīng)驗(yàn) 獲得超7個(gè)贊
這是問(wèn)題所在:
predictions = svc_1.predict(new_face_image)
print ("Confusion Matrix:")
print (metrics.confusion_matrix(y_test, predictions))
您正在預(yù)測(cè) new_face_image 并使用您的測(cè)試數(shù)據(jù)集對(duì)其進(jìn)行預(yù)測(cè)。
predictions = svc_1.predict(new_face_image)
# change this to what you expect but shape=(30,)
expected=np.ones(len(new_face_image))
print ("Confusion Matrix:")
print (metrics.confusion_matrix(expected, predictions))
編輯以使用數(shù)據(jù)集測(cè)試數(shù)據(jù)進(jìn)行驗(yàn)證:
predictions = svc_1.predict(x_test)
print ("Confusion Matrix:")
print (metrics.confusion_matrix(y_test, predictions))
添加回答
舉報(bào)