2021-05-11
阅读量:
1811
python调用sklearn报错: Reshape your data either using array.reshape(-1, 1)
问:
python调用sklearn报错:
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.
答:
这是因为sklearn传入的数据要求是二维矩阵,需要把传入的数据用 .reshape(1,-1) 转换成二维后再调用就可以了。






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论