title: ValueError : x and y must be the same size
body: <p>I have a dataset which i'm trying to calculate Linear regression using sklearn.
  The dataset i'm using is already made so there are not suppose to be problems with it.
  I have used train_test_split in order to split my data into train and test groups. 
  When I try to use matplotlib in order to create scatter plot between my ttest and prediction group, I get the next error:</p>
  
  <blockquote>
    <p>ValueError: x and y must be the same size</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>y=data['Yearly Amount Spent']
  x=data[['Avg. Session Length','Time on App','Time on Website','Length of Membership','Yearly Amount Spent']]
  from sklearn.model_selection import train_test_split
  x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=101)
  
  #training the model
  
  from sklearn.linear_model import LinearRegression
  lm=LinearRegression()
  lm.fit(x_train,y_train)
  lm.coef_
  
  predictions=lm.predict(X_test)
  
  #here the problem starts:
  
  plt.scatter(y_test,predictions)
  </code></pre>
  
  <p>Why does this error occurs?
  I have seen previous posts here and the suggestions for this was to use <strong>x.shape</strong> and <strong>y.shape</strong> but i'm not sure what is the purpose of that. </p>
  
  <p>Thanks</p>