accuracy = Regressor.score([[y_test,y_pred]])
print(accuracy*100,'%')
TypeError Traceback (most recent call last)
<ipython-input-8-ebadb3426777> in <module>()
----> 1 accuracy = Regressor.score([[y_test,y_pred]])
2 print(accuracy*100,'%')
TypeError: score() missing 1 required positional argument: 'y'
答案 0 :(得分:1)
根据:http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html
Regressor.score(X, y)
您只传递了一个参数([[y_test,y_pred]]),请尝试:
Regressor.score(y_test, y_pred)