Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python Data Science Essentials

You're reading from  Python Data Science Essentials

Product type Book
Published in Apr 2015
Publisher Packt
ISBN-13 9781785280429
Pages 258 pages
Edition 1st Edition
Languages
Toc

Hyper-parameters' optimization


A machine learning hypothesis is not only determined by the learning algorithm, but also by its hyper-parameters (the parameters of the algorithm that have to be a priori fixed and which cannot be learned during the training process) and the selection of variables to be used to achieve the best learned parameters.

In this section, we will explore how to extend the cross-validation approach to find the best hyper-parameters that are able to generalize to our test set. We will keep on using the handwritten digits dataset offered by the Scikit-learn package. Here's a useful reminder about how to load the dataset:

In: from sklearn.datasets import load_digits
digits = load_digits()
X, y = digits.data, digits.target

Also, we will keep on using support vector machines as our learning algorithm:

In: from sklearn import svm
h = svm.SVC()
hp = svm.SVC(probability=True, random_state=1)

This time, we will use two hypotheses. The first hypothesis is just the plain SVC that...

lock icon The rest of the chapter is locked
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