text_plain_output_1.png
from sklearn import datasets, linear_model

import matplotlib.pyplot as plt

import numpy as np

diabetes = datasets.load_diabetes()

diabetes_X = diabetes.data[:, np.newaxis, 2]

diabetes_X_train = diabetes_X[:-30]
diabetes_X_test = diabetes_X[-20:]

diabetes_y_train = diabetes.target[:-30]
diabetes_y_test = diabetes.target[-20:]

plt.scatter(diabetes_X_test, diabetes_y_test)