July 2017
Intermediate to advanced
382 pages
9h 13m
English
We can again thank scikit-learn for easy access to the dataset. We first import all the necessary modules, as we did earlier:
In [1]: import numpy as np... from sklearn import datasets... from sklearn import metrics... from sklearn import model_selection as modsel... from sklearn import linear_model... %matplotlib inline... import matplotlib.pyplot as plt... plt.style.use('ggplot')
Then, loading the dataset is a one-liner:
In [2]: boston = datasets.load_boston()
The structure of the boston object is identical to the iris object, as discussed in the preceding command. We can get more information about the dataset in 'DESCR', find all data in 'data', all feature names in 'feature_names', and all target values in 'target' ...
Read now
Unlock full access