我正在努力理解如何实现精确性和回忆性。假设clf
是分类器,y_test[i]
是真值,X_test[i].reshape(1,-1)
是预测值,这些定义正确吗?在
精度
def testPosValueMetric(clf, X_test, y_test):
success =0
fail = 0
for i in range(len(y_test)):
if y_test[i] == 1:
if clf.predict(X_test[i].reshape(1,-1)) == 1:
success += 1
else:
fail +=1
return (success/(success+fail))
回忆
^{pr2}$
目前没有回答
相关问题 更多 >
编程相关推荐