###Splitting the dataset into training and testing datasetsfromsklearn.cross_validationimporttrain_test_splithouse_train,house_test=train_test_split(house,train_size=0.9)

In [5]:

###Building a linear Regression with medv as the predictor variable on the traiing dadaset ###fromsklearn.linear_modelimportLinearRegressionlr=LinearRegression()lr.fit(house_train[['crim']+['zn']+['indus']+['chas']+['nox']+['rm']+['age']+['dis']+['rad']+['tax']+['ptratio']+['black']+['lstat']],house_train[['medv']])