<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 MAT245 Lab 5 - Linear Regression
Overview
Regression analysis is a set of statistical techniques for modelling the relationships between a dependent variable and a set of independent (or predictor) variables. Linear regression in particular assumes these relationships are linear. We are going to explore a few different ways of finding "optimal" parameters for a linear regression model. 
Loading the data
We will be working with a subset of scikit-learn's Boston housing dataset. The goal is to construct a linear regression model that predicts the price of a house given a few metrics about the neighbourhood it's in. The Boston data can be loaded by
Step1:  There are thirteen columns of data, and 506 samples. A description of what each column means can be found by investigating  bost['DESCR']. For visualization purposes, we'll work with a 2 dimensional subset
Step2:  The data in column index 2 represents proportion of non-retail business acres in the town, while column index 12 is the median value of owner-occupied homes in the neighbourhood, priced in $1000's.
The target variable (i.e. what we want to predict) are the house prices, these are stored in bost.target. Let's plot house prices as a function of our inputs to see what we're dealing with.
<ASSISTANT_TASK:>
Python Code:
from sklearn import datasets
bost = datasets.load_boston()
bost.keys()
bost.data.shape
Explanation: MAT245 Lab 5 - Linear Regression
Overview
Regression analysis is a set of statistical techniques for modelling the relationships between a dependent variable and a set of independent (or predictor) variables. Linear regression in particular assumes these relationships are linear. We are going to explore a few different ways of finding "optimal" parameters for a linear regression model. 
Loading the data
We will be working with a subset of scikit-learn's Boston housing dataset. The goal is to construct a linear regression model that predicts the price of a house given a few metrics about the neighbourhood it's in. The Boston data can be loaded by:
End of explanation
xs = bost.data[:, [2, 12]]
Explanation: There are thirteen columns of data, and 506 samples. A description of what each column means can be found by investigating  bost['DESCR']. For visualization purposes, we'll work with a 2 dimensional subset:
End of explanation
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(10,10))
for i in range(1, 10):
    ax = fig.add_subplot(3, 3, i, projection='3d')
    ax.view_init(elev=10., azim = (360.0 / 9.) * (i - 1))
    ax.scatter(xs[:,0], xs[:,1], bost.target)
    
plt.show()
Explanation: The data in column index 2 represents proportion of non-retail business acres in the town, while column index 12 is the median value of owner-occupied homes in the neighbourhood, priced in $1000's.
The target variable (i.e. what we want to predict) are the house prices, these are stored in bost.target. Let's plot house prices as a function of our inputs to see what we're dealing with.
End of explanation
<END_TASK>