November 2017
Intermediate to advanced
1035 pages
11h 31m
English
Now, we get to do some modeling! It's best to start simple; therefore, we'll look at linear regression first. Linear regression is the first, and therefore, probably the most fundamental model—a straight line through data.
The boston dataset is perfect to play around with regression. The boston dataset has the median home price of several areas in Boston. It also has other factors that might impact housing prices, for example, crime rate.
First, import the datasets model, then we can load the dataset:
>>> from sklearn import datasets >>> boston = datasets.load_boston()
Actually, using linear regression in scikit-learn is quite simple. The API for linear regression is basically the same API ...
Read now
Unlock full access