输出Accuracy Score的代码
时间: 2023-05-31 18:07:58 浏览: 63
Logictic回归代码实现
以下是输出准确率(Accuracy Score)的 Python 代码:
from sklearn.metrics import accuracy_score
y_true = [0, 1, 0, 1, 1, 1]
y_pred = [0, 1, 1, 1, 1, 0]
accuracy = accuracy_score(y_true, y_pred)
print("Accuracy Score:", accuracy)
输出结果为:
Accuracy Score: 0.6666666666666666
阅读全文