READING-NOTE

View on GitHub

Linear_Regressions

Exploring Boston Housing Data Set

The object boston is a dictionary, so you can explore the keys of this dictionary.

I am going to print the feature names of boston data set.

I am going to convert boston.data into a pandas data frame.

As you can see the column names are just numbers, so I am going to replace those numbers with the feature names.

boston.target contains the housing prices.

I am going to add these target prices to the bos data frame.

Scikit Learn

In this section I am going to fit a linear regression model and predict the Boston housing prices. I will use the least squares method as the way to estimate the coefficients.

Y = boston housing price(also called “target” data in Python)

and

X = all the other features (or independent variables)

First, I am going to import linear regression from sci-kit learn module. Then I am going to drop the price column as I want only the parameters as my X values. I am going to store linear regression object in a variable called lm.

to learn more visit this link