I'm trying to run a simple linear regression of in sklearn. I have a Pandas dataframe with two columns, "Likes" and "Attendance" Both columns have 18 samples.
lr = LinearRegression()
lr.fit(Likes,Attendance)
I get the following error:
C:\Anaconda3\lib\site-packages\sklearn\utils\validation.py:386: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and willraise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample. DeprecationWarning)
...
ValueError: Found arrays with inconsistent numbers of samples: [ 1 18]
Even after I reshaped the data using Likes.reshape(-1, 1), I got the same error.
Can anyone help?