Artificial Intelligence with Python
Second Edition
Your complete guide to building intelligent apps using Python 3.x and TensorFlow 2
Alberto Artasanchez
Prateek Joshi
BIRMINGHAM - MUMBAI
Artificial Intelligence with Python
Second Edition
Copyright 2020 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 authors, 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.
Producer: Tushar Gupta
Acquisition Editor Peer Reviews: Suresh Jain
Content Development Editor: Ian Hough
Technical Editor: Aniket Shetty
Project Editor: Carol Lewis
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Presentation Designer: Sandip Tadge
First published: January 2017
Second edition: January 2020
Production reference: 1300120
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-83921-953-5
www.packt.com
packt.com
Subscribe to our online digital library for full access to over 7,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
- Learn better with Skill Plans built especially for you
- Get a free eBook or video every month
- Fully searchable for easy access to vital information
- Copy and paste, print, and bookmark content
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 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.
Contributors
About the authors
Alberto Artasanchez is a data scientist with over 25 years of consulting experience with Fortune 500 companies as well as startups. He has an extensive background in artificial intelligence and advanced algorithms. Mr. Artasanchez holds 9 AWS certifications including the Big Data Specialty and the Machine Learning Specialty certifications. He is an AWS Ambassador and publishes frequently in a variety of data science blogs. He is often tapped as a speaker on topics ranging from Data Science, Big Data, and Analytics to underwriting optimization and fraud detection. He has a strong and extensive track record designing and building end-to-end machine learning platforms at scale.
He graduated with a Master of Science degree from Wayne State University and a Bachelor of Arts degree from Kalamazoo College. He is particularly interested in using Artificial Intelligence to build Data Lakes at scale. He is married to his lovely wife Karen and is addicted to CrossFit.
I would like to thank the wonderful editors at Packt for all the help. This book would have never been completed without their invaluable assistance. They are Ian Hough, Carol Lewis, Ajinkya Kolhe, Aniket Shetty, and Tushar Gupta. I would also like to thank my amazing wife Karen Artasanchez for her support and patience, not just with this book but for her continued support in all my crazy endeavors. I would like to dedicate this book to my father Alberto Artasanchez Madrigal and my mother Laura Loy Loy.
Prateek Joshi is the founder of Plutoshift and a published author of 9 books on artificial intelligence. He has been featured on Forbes 30 Under 30, NBC, Bloomberg, CNBC, TechCrunch, and The Business Journals. He has been an invited speaker at conferences such as TEDx, Global Big Data Conference, Machine Learning Developers Conference, and Silicon Valley Deep Learning. His tech blog ( www.prateekjoshi.com ) has received more than 2M page views from 200+ countries and has 7,500+ followers. You can learn more about him on www.prateekj.com . Apart from artificial intelligence, some of the topics that excite him are number theory, cryptography, and quantum computing. His greater goal is to make artificial intelligence accessible to everyone so that it can impact billions of people around the world.
About the reviewer
Ajinkya Kolhe is a Data Analytics and Machine Learning Instructor. He started his journey as a software developer at Morgan Stanley and transitioned into the machine learning field. He is now working as an instructor to help companies and individuals to get started with Artificial Intelligence.
Preface
Recent advances in artificial intelligence (AI) have placed great power into the hands of humans. With great power comes a proportional level of responsibility. Self-driving cars, chatbots, and increasingly accurate predictions of the future are but a few examples of AIs ability to supercharge humankinds capacity for growth and advancement.
AI is becoming a core, transformative path that is changing the way we think about every aspect of our lives. It is impacting industry. It is becoming pervasive and embedded in our everyday lives. Most excitingly, this is a field that is still in its infancy: the AI revolution has only just begun.
As we collect more and more data and tackle that data with better and faster algorithms, we can use AI to build increasingly accurate models and to answer increasingly complex, previously intractable questions.
From this, it will come as no surprise that the ability to work with and fully utilize AI will be a skill that is set only to increase in value. In this book, we explore various real-world scenarios and learn how to apply relevant AI algorithms to a wide swath of problems.
The book starts with the most basic AI concepts and progressively builds on these concepts to solve increasingly difficult problems. It will use the initial knowledge gleaned during the beginning chapters as a foundation to allow the reader to explore and tackle some of the more complicated problems in AI. By the end of the book, the reader will have gained a solid understanding of many AI techniques and will have gained confidence about when to use these techniques.
We will start by talking about various realms of AI. Well then move on to discuss more complex algorithms, such as extremely random forests, Hidden Markov Models, genetic algorithms, artificial neural networks, convolutional neural networks, and so on.