We will capitalize on the SVM classification recipes by performing support vector regression on scikit-learn's diabetes dataset.
Support vector regression
Getting ready
Load the diabetes dataset:
#load the libraries we have been using
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets
diabetes = datasets.load_diabetes()
X = diabetes.data
y = diabetes.target
Split the data in training and testing sets. There is no stratification for regression in this case:
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=7)