我正在使用scikit-learn的linear_model.LinearRegression
作为预测模型。它运行良好,非常完美。但是当我尝试使用accuracy_score
评估预测结果时出现问题。
以下是我的真实数据:
array([1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0])
我的预测数据:
array([ 0.07094605, 0.1994941 , 0.19270157, 0.13379635, 0.04654469,
0.09212494, 0.19952108, 0.12884365, 0.15685076, -0.01274453,
0.32167554, 0.32167554, -0.10023553, 0.09819648, -0.06755516,
0.25390082, 0.17248324])
我的代码:
accuracy_score(y_true, y_pred, normalize=False)
错误信息:
ValueError: Can't handle mix of binary and continuous target