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

前端 未结 5 1879
再見小時候
再見小時候 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:37

    It seems to be fixable if you specify the target labels as a single data column from Pandas. If the target has multiple columns, I get a similar error. For example try:

    labels = train['Y']
    

提交回复
热议问题