4. Training Classification Models
Activity 4.01: Training and Visualizing SVM Models with Scikit-learn
Solution:
- Create a new Jupyter notebook.
- In the first cell, add the following lines of code to load the libraries we'll be using and set up our plot environment for the notebook:
import numpy as np import datetime import time import os import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns %config InlineBackend.figure_format='retina' sns.set() # Revert to matplotlib defaults plt.rcParams['figure.figsize'] = (8, 8) plt.rcParams['axes.labelpad'] = 10 sns.set_style("darkgrid")
- In the next cell, enter the following code to print the date, version numbers, and hardware information:
%load_ext watermark %watermark -d -v -m -p \ requests,numpy,pandas,matplotlib,seaborn,sklearn
You should get the following output:
- Load the preprocessed Human Resource...