November 2017
Intermediate to advanced
374 pages
10h 19m
English
For this example, load scikit-learn's diabetes dataset:
#Use within an Jupyter notebook%matplotlib inline import numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom sklearn.datasets import load_diabetesdiabetes = load_diabetes()X = diabetes.datay = diabetes.targetX_feature_names = ['age', 'gender', 'body mass index', 'average blood pressure','bl_0','bl_1','bl_2','bl_3','bl_4','bl_5']
Now that we have loaded the dataset, we must split the data into training and testing subsets. Before doing that, however, visualize the target variable using pandas:
pd.Series(y).hist(bins=50)

This is a regression example, and we cannot ...
Read now
Unlock full access