title: How to fit a linear regression model using three independent variables and calculate the mean squared error using sklearn?
body: <p>I'm trying to fit a linear regression model using three independent variables and calculate the mean squared error using sklearn, but I seem not be able to get it right.</p>
  
  <p>My data is the Boston Housing, and three independent variables are as follow: 
  1. CRIM (per capita crime rate by town)
  2. RM (average number of rooms per dwelling)
  3. PTRATIO (pupil-teacher ratio by town)</p>
  
  <p>Fit model:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import pandas as pd
  import matplotlib as mpl
  import matplotlib.pyplot as plt
  import sklearn
  lm = LinearRegression()
  lm.fit(X[['CRIM']['RM'], ['PTRATIO']], boston_df.PRICE)
  </code></pre>
  
  <p>Calculate the mean square error</p>
  
  <pre class="lang-py prettyprint-override"><code>from sklearn.metrics import mean_squared_error
  y_true = ['CRIM', 'RM', 'PTRATIO']
  y_pred = ['PRICE']
  mean_squared_error(y_true, y_pred)
  </code></pre>
  
  <p>Any advice or hints are much appreciated!</p>