Machine Learning Pocket Reference
by Matt Harrison
Copyright 2019 Matt Harrison. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Acquisitions Editor: Rachel Roumeliotis
- Development Editor: Nicole Tache
- Production Editor: Christopher Faucher
- Copyeditor: Sonia Saruba
- Proofreader: Christina Edwards
- Indexer: WordCo Indexing Services, Inc.
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Rebecca Demarest
- September 2019: First Edition
Revision History for the First Edition
- 2019-08-27: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781492047544 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Machine Learning Pocket Reference, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-492-04754-4
[LSI]
Preface
Machine learning and data science are very popular right now andare fast-moving targets. I have worked with Python and data formost of my career and wanted to have a physical book thatcould provide a reference for the common methods that I havebeen using in industry and teaching during workshops to solvestructured machine learning problems.
This book is what I believe is the best collection of resourcesand examples for attacking a predictive modeling task if youhave structured data. There are many libraries that perform aportion of the tasks required and I have tried to incorporatethose that I have found useful as I have applied these techniquesin consulting or industry work.
Many may lament the lack of deep learning techniques. Thosecould be a book by themselves. I also prefer simpler techniquesand others in industry seem to agree. Deep learning for unstructureddata (video, audio, images), and powerful tools like XGBoost forstructured data.
I hope this book serves as a useful reference for you to solvepressing problems.
What to Expect
This book gives in-depth examples of solving common structured dataproblems. It walks through various libraries and models, theirtrade-offs, how to tune them, and how to interpret them.
The code snippets are meant to be sized such that you can useand adapt them in your own projects.
Who This Book Is For
If you are just learning machine learning, or have worked withit for years, this book should serve as a valuable reference. It assumessome knowledge of Python, and doesnt delve at all into syntax.Rather it shows how to use various libraries to solve real-worldproblems.
This will not replace an in-depth course, but should serve as areference of what an applied machine learning course might cover.(Note: The author uses it as a reference for the data analyticsand machine learning courses he teaches.)
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Tip
This element signifies a tip or suggestion.
Note
This element signifies a general note.
Warning
This element indicates a warning or caution.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available at https://github.com/mattharrison/ml_pocket_reference.
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: Machine Learning Pocket Reference by Matt Harrison (OReilly). Copyright 2019 Matt Harrison, 978-1-492-04754-4.
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .
OReilly Online Learning
Note
For almost 40 years, OReilly Media has provided technology and business training, knowledge, and insight to help companies succeed.
Our unique network of experts and innovators share their knowledge and expertise through books, articles, conferences, and our online learning platform. OReillys online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from OReilly and 200+ other publishers. For more information, please visit http://oreilly.com.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
- OReilly Media, Inc.
- 1005 Gravenstein Highway North
- Sebastopol, CA 95472
- 800-998-9938 (in the United States or Canada)
- 707-829-0515 (international or local)
- 707-829-0104 (fax)
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://www.oreilly.com/catalog/9781492047544.
To comment or ask technical questions about this book, send email to .
For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Acknowledgments
Much thanks to my wife and family for their support. Im grateful to the Python communityfor providing a wonderful language and toolset to work with. Nicole Tache has been lovely to work with and provided excellent feedback. My technical reviewers, Mikio Braun, Natalino Busa, and Justin Francis, kept me honest. Thanks!