Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building Data Science Solutions with Anaconda

You're reading from  Building Data Science Solutions with Anaconda

Product type Book
Published in May 2022
Publisher Packt
ISBN-13 9781800568785
Pages 330 pages
Edition 1st Edition
Languages
Author (1):
Dan Meador Dan Meador
Profile icon Dan Meador

Table of Contents (16) Chapters

Preface 1. Part 1: The Data Science Landscape – Open Source to the Rescue
2. Chapter 1: Understanding the AI/ML landscape 3. Chapter 2: Analyzing Open Source Software 4. Chapter 3: Using the Anaconda Distribution to Manage Packages 5. Chapter 4: Working with Jupyter Notebooks and NumPy 6. Part 2: Data Is the New Oil, Models Are the New Refineries
7. Chapter 5: Cleaning and Visualizing Data 8. Chapter 6: Overcoming Bias in AI/ML 9. Chapter 7: Choosing the Best AI Algorithm 10. Chapter 8: Dealing with Common Data Problems 11. Part 3: Practical Examples and Applications
12. Chapter 9: Building a Regression Model with scikit-learn 13. Chapter 10: Explainable AI - Using LIME and SHAP 14. Chapter 11: Tuning Hyperparameters and Versioning Your Model 15. Other Books You May Enjoy

Finding optimal hyperparameters with GridSearchCV

As we have created new models and tried various data processing techniques, we have used many different parameters and function arguments to determine how we set up the problem. One example is the impute method. Mean, median, or some other advanced approach – how do we know which we should take? One naïve approach might be to simply create a for loop and try every technique. We can calculate the score for each and use the best one. We tried a similar approach before when looking at which algorithm would give us the best score in the previous section.

This might be naïve, but never overlook the simple. It is such a good approach that scikit-learn decided to package that together and make an easy method to do so. It will even perform a k-fold cross-validation to make sure it is getting the best solution. There are a few different ways to tune hyperparameters, but we're going to focus on a grid search.

A grid...

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}