Supervised Machine Learning with Python
Develop rich Python coding practices while exploring supervised machine learning
Taylor Smith
BIRMINGHAM - MUMBAI
Supervised Machine Learning with Python
Copyright 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Mrinmayee Kawalkar
Acquisition Editor: Joshua Nadar
Content Development Editor: Ronnel Mathew
Technical Editor: Suwarna Patil
Copy Editor: Safis Editing
Project Coordinator: Hardik Bhinde
Proofreader: Safis Editing
Indexer: Manju Arasan
Graphics: Tom Scaria
Production Coordinator: Shraddha Falebhai
First published: May 2019
Production reference: 1200519
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-83882-566-9
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Packt.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributor
About the author
Taylor Smith is a machine learning enthusiast with over five years of experience who loves to apply interesting computational solutions to challenging business problems. Currently working as a principal data scientist, Taylor is also an active open source contributor and staunch Pythonista.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
Supervised machine learning is used in a wide range of sectors such as finance, online advertising, and analytics because it allows you to train your system to make pricing predictions, campaign adjustments, customer recommendations, and much more, giving the system the ability to self-adjust and make decisions on its own. The benefits this can give make it crucial to know how a machine learns under the hood.
This book will guide you through the implementation and nuances of many popular supervised machine learning algorithms. You'll embark on this journey with a quick overview and see how supervised machine learning differs from unsupervised learning. After that, we will explore parametric models such as linear and logistic regression, non-parametric methods such as decision trees, and various clustering techniques to facilitate decision-making and predictions. As we proceed, you'll work with recommender systems, which are widely used by online companies to increase user interaction and boost potential sales. Finally, we'll wrap up with a brief foray into neural networks and transfer learning.
By the end of this book, you'll be equipped with hands-on techniques to gain the practical know-how needed to quickly and powerfully apply supervised learning algorithms to new problems.
Who this book is for
This book is for aspiring machine learning developers who want to get started with supervised learning. Intermediate knowledge of Python programming and some fundamental knowledge of supervised learning is expected.
What this book covers
, First Step toward Supervised Learning , covers the basics of supervised machine learning to get you prepared to start tackling problems on your own. The chapter comprises four important sections. First, we will get our Anaconda environment set up and make sure that we are able to run the examples. Over the next couple of sections following that, we will cover a bit more of the theory behind machine learning, before we start implementing algorithms in the final section, where we'll get our Anaconda environment set up.
, Implementing Parametric Models , dives into the guts of several popular supervised learning algorithms within the parametric modeling family. We'll start this section by formally introducing parametric models, then we'll focus on two very popular parametric models in particular: linear and logistic regression. We'll spend some time understanding the inner workings and then jump into Python and actually code them from scratch.
, Working with Non-Parametric Models , explores the non-parametric model family. We will start by covering the bias-variance trade-off, and explain how parametric and non-parametric models differ at a fundamental level. We will then get into decision trees and clustering methods. Finally, we'll address some of the pros and cons of non-parametric models.
, Advanced Topics in Supervised ML , splits its time between two topics: recommender systems and neural networks. We'll start with collaborative filtering and then talk about integrating content-based similarities into your collaborative filtering systems. Finally, we'll get into neural networks and transfer learning.
Next page