2021-05-11
閱讀量:
1837
python調(diào)用sklearn報錯: Reshape your data either using array.reshape(-1, 1)
問:
python調(diào)用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傳入的數(shù)據(jù)要求是二維矩陣,需要把傳入的數(shù)據(jù)用 .reshape(1,-1) 轉(zhuǎn)換成二維后再調(diào)用就可以了。






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
0條評論
0條評論