Scikit-learn is returning coefficient of determination (R^2) values less than -1

前端 未结 4 946
陌清茗
陌清茗 2021-01-30 18:12

I\'m doing a simple linear model. I have

fire = load_data()
regr = linear_model.LinearRegression()
scores = cross_validation.cross_val_score(regr, fire.data, fir         


        
4条回答
  •  迷失自我
    2021-01-30 18:32

    If you are getting negative regression r^2 scores, make sure to remove any unique identifier (e.g. "id" or "rownum") from your dataset before fitting/scoring the model. Simple check, but it'll save you some headache time.

提交回复
热议问题