47,85 €
New edition of the bestselling guide to artificial intelligence with Python, updated to Python 3.x, with seven new chapters that cover RNNs, AI and Big Data, fundamental use cases, chatbots, and more.
Key Features
Book Description
Artificial Intelligence with Python, Second Edition is an updated and expanded version of the bestselling guide to artificial intelligence using the latest version of Python 3.x. Not only does it provide you an introduction to artificial intelligence, this new edition goes further by giving you the tools you need to explore the amazing world of intelligent apps and create your own applications.
This edition also includes seven new chapters on more advanced concepts of Artificial Intelligence, including fundamental use cases of AI; machine learning data pipelines; feature selection and feature engineering; AI on the cloud; the basics of chatbots; RNNs and DL models; and AI and Big Data.
Finally, this new edition explores various real-world scenarios and teaches you how to apply relevant AI algorithms to a wide swath of problems, starting with the most basic AI concepts and progressively building from there to solve more difficult challenges so that by the end, you will have gained a solid understanding of, and when best to use, these many artificial intelligence techniques.
What you will learn
Who this book is for
The intended audience for this book is Python developers who want to build real-world Artificial Intelligence applications. Basic Python programming experience and awareness of machine learning concepts and techniques is mandatory.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 723
Veröffentlichungsjahr: 2020
Artificial Intelligence with Python
Second Edition
Your complete guide to building intelligent apps using Python 3.x
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: 2030220
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.
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 [email protected] 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
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.
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
Who this book is for
What this book covers
What you need for this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Introduction to Artificial Intelligence
What is AI?
Why do we need to study AI?
Branches of AI
The five tribes of machine learning
Defining intelligence using the Turing test
Making machines think like humans
Building rational agents
General Problem Solver
Solving a problem with GPS
Building an intelligent agent
Types of models
Installing Python 3
Installing on Ubuntu
Installing on Mac OS X
Installing on Windows
Installing packages
Loading data
Summary
Fundamental Use Cases for Artificial Intelligence
Representative AI use cases
Digital personal assistants and chatbots
Personal chauffeur
Shipping and warehouse management
Human health
Knowledge search
Recommendation systems
The smart home
Gaming
Movie making
Underwriting and deal analysis
Data cleansing and transformation
Summary
References
Machine Learning Pipelines
What is a machine learning pipeline?
Problem definition
Data ingestion
Data preparation
Missing values
Duplicate records or values
Feature scaling
Inconsistent values
Inconsistent date formatting
Data segregation
Model training
Candidate model evaluation and selection
Model deployment
Performance monitoring
Model performance
Operational performance
Total cost of ownership (TCO)
Service performance
Summary
Feature Selection and Feature Engineering
Feature selection
Feature importance
Univariate selection
Correlation heatmaps
Wrapper-based methods
Filter-based methods
Embedded methods
Feature engineering
Imputation
Outlier management
One-hot encoding
Log transform
Scaling
Date manipulation
Summary
Classification and Regression Using Supervised Learning
Supervised versus unsupervised learning
What is classification?
Preprocessing data
Binarization
Mean removal
Scaling
Normalization
Label encoding
Logistic regression classifiers
The Naïve Bayes classifier
Confusion matrixes
Support Vector Machines
Classifying income data using Support Vector Machines
What is regression?
Building a single-variable regressor
Building a multivariable regressor
Estimating housing prices using a Support Vector Regressor
Summary
Predictive Analytics with Ensemble Learning
What are decision trees?
Building a decision tree classifier
What is ensemble learning?
Building learning models with ensemble learning
What are random forests and extremely random forests?
Building random forest and extremely random forest classifiers
Estimating the confidence measure of the predictions
Dealing with class imbalance
Finding optimal training parameters using grid search
Computing relative feature importance
Predicting traffic using an extremely random forest regressor
Summary
Detecting Patterns with Unsupervised Learning
What is unsupervised learning?
Clustering data with the K-Means algorithm
Estimating the number of clusters with the Mean Shift algorithm
Estimating the quality of clustering with silhouette scores
What are Gaussian Mixture Models?
Building a classifier based on Gaussian Mixture Models
Finding subgroups in stock market using the Affinity Propagation model
Segmenting the market based on shopping patterns
Summary
Building Recommender Systems
Extracting the nearest neighbors
Building a K-nearest neighbors classifier
Computing similarity scores
Finding similar users using collaborative filtering
Building a movie recommendation system
Summary
Logic Programming
What is logic programming?
Understanding the building blocks of logic programming
Solving problems using logic programming
Installing Python packages
Matching mathematical expressions
Validating primes
Parsing a family tree
Analyzing geography
Building a puzzle solver
Summary
Heuristic Search Techniques
Is heuristic search artificial intelligence?
What is heuristic search?
Uninformed versus informed search
Constraint satisfaction problems
Local search techniques
Simulated annealing
Constructing a string using greedy search
Solving a problem with constraints
Solving the region-coloring problem
Building an 8-puzzle solver
Building a maze solver
Summary
Genetic Algorithms and Genetic Programming
The evolutionists tribe
Understanding evolutionary and genetic algorithms
Fundamental concepts in genetic algorithms
Generating a bit pattern with predefined parameters
Visualizing the evolution
Solving the symbol regression problem
Building an intelligent robot controller
Genetic programming use cases
Summary
References
Artificial Intelligence on the Cloud
Why are companies migrating to the cloud?
The top cloud providers
Amazon Web Services (AWS)
Amazon SageMaker
Alexa, Lex, and Polly – conversational gents
Amazon Comprehend – natural language processing
Amazon Rekognition – image and video
Amazon Translate
Amazon Machine Learning
Amazon Transcribe – transcription
Amazon Textract – document analysis
Microsoft Azure
Microsoft Azure Machine Learning Studio
Azure Machine Learning Service
Azure Cognitive Services
Google Cloud Platform (GCP)
AI Hub
Google Cloud AI Building Blocks
Summary
Building Games with Artificial Intelligence
Using search algorithms in games
Combinatorial search
The Minimax algorithm
Alpha-Beta pruning
The Negamax algorithm
Installing the easyAI library
Building a bot to play Last Coin Standing
Building a bot to play Tic-Tac-Toe
Building two bots to play Connect Four™ against each other
Building two bots to play Hexapawn against each other
Summary
Building a Speech Recognizer
Working with speech signals
Visualizing audio signals
Transforming audio signals to the frequency domain
Generating audio signals
Synthesizing tones to generate music
Extracting speech features
Recognizing spoken words
Summary
Natural Language Processing
Introduction and installation of packages
Tokenizing text data
Converting words to their base forms using stemming
Converting words to their base forms using lemmatization
Dividing text data into chunks
Extracting the frequency of terms using the Bag of Words model
Building a category predictor
Constructing a gender identifier
Building a sentiment analyzer
Topic modeling using Latent Dirichlet Allocation
Summary
Chatbots
The future of chatbots
Chatbots today
Chatbot concepts
A well-architected chatbot
Chatbot platforms
Creating a chatbot using DialogFlow
DialogFlow setup
Integrating a chatbot into a website using a widget
Integrating a chatbot into a website using Python
How to set up a webhook in DialogFlow
Enabling webhooks for intents
Setting up training phrases for an intent
Setting up parameters and actions for an intent
Building fulfillment responses from a webhook
Checking responses from a webhook
Summary
Sequential Data and Time Series Analysis
Understanding sequential data
Handling time series data with Pandas
Slicing time series data
Operating on time series data
Extracting statistics from time series data
Generating data using Hidden Markov Models
Identifying alphabet sequences with Conditional Random Fields
Stock market analysis
Summary
Image Recognition
Importance of image recognition
OpenCV
Frame differencing
Tracking objects using color spaces
Object tracking using background subtraction
Building an interactive object tracker using the CAMShift algorithm
Optical flow-based tracking
Face detection and tracking
Using Haar cascades for object detection
Using integral images for feature extraction
Eye detection and tracking
Summary
Neural Networks
Introduction to neural networks
Building a neural network
Training a neural network
Building a Perceptron-based classifier
Constructing a single-layer neural network
Constructing a multi-layer neural network
Building a vector quantizer
Analyzing sequential data using recurrent neural networks
Visualizing characters in an optical character recognition database
Building an optical character recognition engine
Summary
Deep Learning with Convolutional Neural Networks
The basics of Convolutional Neural Networks
Architecture of CNNs
CNNs vs. perceptron neural networks
Types of layers in a CNN
Building a perceptron-based linear regressor
Building an image classifier using a single-layer neural network
Building an image classifier using a Convolutional Neural Network
Summary
Reference
Recurrent Neural Networks and Other Deep Learning Models
The basics of Recurrent Neural Networks
Step function
Sigmoid function
Tanh function
ReLU function
Architecture of RNNs
A language modeling use case
Training an RNN
Summary
Creating Intelligent Agents with Reinforcement Learning
Understanding what it means to learn
Reinforcement learning versus supervised learning
Real-world examples of reinforcement learning
Building blocks of reinforcement learning
Creating an environment
Building a learning agent
Summary
Artificial Intelligence and Big Data
Big data basics
Crawling
Indexing
Ranking
Worldwide datacenters
Distributed lookups
Custom software
The three V's of big data
Volume
Velocity
Variety
Big data and machine learning
Apache Hadoop
MapReduce
Apache Hive
Apache Spark
Resilient distributed datasets
DataFrames
SparkSQL
Apache Impala
NoSQL Databases
Types of NoSQL databases
Apache Cassandra
MongoDB
Redis
Neo4j
Summary
Other Books You May Enjoy
Index
Cover
Index
