Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
The Applied Data Science Workshop - Second Edition

You're reading from  The Applied Data Science Workshop - Second Edition

Product type Book
Published in Jul 2020
Publisher Packt
ISBN-13 9781800202504
Pages 352 pages
Edition 2nd Edition
Languages
Author (1):
Alex Galea Alex Galea
Profile icon Alex Galea

4. Training Classification Models

Activity 4.01: Training and Visualizing SVM Models with Scikit-learn

Solution:

  1. Create a new Jupyter notebook.
  2. 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")
  3. 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:

    Figure 4.19: Output of loading all the required libraries

  4. Load the preprocessed Human Resource...
lock icon The rest of the chapter is locked
arrow left Previous Chapter
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}