Scikit-learn cross val score: too many indices for array

前端 未结 5 1867
再見小時候
再見小時候 2020-12-15 05:15

I have the following code

 from sklearn.ensemble import ExtraTreesClassifier
 from sklearn.cross_validation import cross_val_score
 #split the dataset for tr         


        
5条回答
  •  情深已故
    2020-12-15 05:41

    try target:

    y=df['Survived'] 
    

    instead , i used

    y=df[['Survived']] 
    

    which made the target y a dateframe, it seems series would be ok

提交回复
热议问题