2021-05-11
阅读量:
1944
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) 转换成二维后再调用就可以了。
102.8571
1
0
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
0条评论
0条评论
0条评论

