Can't do linear regression in scikit-Learn due to “reshaping” issue

后端 未结 4 759
故里飘歌
故里飘歌 2021-01-06 15:36

I have a simple CSV with two columns:

  1. ErrorWeek (a number for the week number in the year)
  2. ErrorCount (for the number of errors in a given week)
4条回答
  •  甜味超标
    2021-01-06 16:25

    Try this:

    X_train, X_test, y_train, y_test = train_test_split(
        df[['ErrorWeek']], df['ErrorCount'], random_state=0)
    

    PS pay attention at additional square brackets: df[['ErrorWeek']]

提交回复
热议问题