【发布时间】:2020-12-18 07:47:23
【问题描述】:
我曾经通过使用 GridSearchCV 调整参数来使用线性回归构建模型。 在找到分数的情况下,我无法找到。它表明,
array=[1 1 1 1 1 0 0 0 1 1 0 0 1 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1]
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
我使用了代码。
model.score(y_pred,y_test)
这是什么问题!!! 和model.score(取什么类型的数据)
y_pred 是一个从回归器给出的单维数组。但它不能带入分数功能。我能做些什么?以及它的解决方案是什么?
【问题讨论】:
标签: pandas numpy machine-learning data-science linear-regression