Artificial Intelligence with Python - Second Edition

Book description

New edition of the bestselling guide to artificial intelligence with Python, updated to Python 3.x and TensorFlow 2, with seven new chapters that cover RNNs, AI & Big Data, fundamental use cases, chatbots, and more.

Key Features

  • Completely updated and revised to Python 3.x and TensorFlow 2
  • New chapters for AI on the cloud, recurrent neural networks, deep learning models, and feature selection and engineering
  • Learn more about deep learning algorithms, machine learning data pipelines, and chatbots

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 and TensorFlow 2. 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

  • Understand what artificial intelligence, machine learning, and data science are
  • Explore the most common artificial intelligence use cases
  • Learn how to build a machine learning pipeline
  • Assimilate the basics of feature selection and feature engineering
  • Identify the differences between supervised and unsupervised learning
  • Discover the most recent advances and tools offered for AI development in the cloud
  • Develop automatic speech recognition systems and chatbots
  • Apply AI algorithms to time series data

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.

Table of contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. What you need for this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  2. Introduction to Artificial Intelligence
    1. What is AI?
    2. Why do we need to study AI?
    3. Branches of AI
    4. The five tribes of machine learning
    5. Defining intelligence using the Turing test
    6. Making machines think like humans
    7. Building rational agents
    8. General Problem Solver
      1. Solving a problem with GPS
    9. Building an intelligent agent
      1. Types of models
    10. Installing Python 3
      1. Installing on Ubuntu
      2. Installing on Mac OS X
      3. Installing on Windows
    11. Installing packages
    12. Loading data
    13. Summary
  3. Fundamental Use Cases for Artificial Intelligence
    1. Representative AI use cases
    2. Digital personal assistants and chatbots
    3. Personal chauffeur
    4. Shipping and warehouse management
    5. Human health
    6. Knowledge search
    7. Recommendation systems
    8. The smart home
    9. Gaming
    10. Movie making
    11. Underwriting and deal analysis
    12. Data cleansing and transformation
    13. Summary
    14. References
  4. Machine Learning Pipelines
    1. What is a machine learning pipeline?
    2. Problem definition
    3. Data ingestion
    4. Data preparation
      1. Missing values
      2. Duplicate records or values
      3. Feature scaling
      4. Inconsistent values
      5. Inconsistent date formatting
    5. Data segregation
    6. Model training
      1. Candidate model evaluation and selection
      2. Model deployment
      3. Performance monitoring
        1. Model performance
        2. Operational performance
        3. Total cost of ownership (TCO)
        4. Service performance
    7. Summary
  5. Feature Selection and Feature Engineering
    1. Feature selection
      1. Feature importance
      2. Univariate selection
      3. Correlation heatmaps
        1. Wrapper-based methods
        2. Filter-based methods
        3. Embedded methods
    2. Feature engineering
      1. Imputation
    3. Outlier management
    4. One-hot encoding
    5. Log transform
    6. Scaling
    7. Date manipulation
    8. Summary
  6. Classification and Regression Using Supervised Learning
    1. Supervised versus unsupervised learning
    2. What is classification?
    3. Preprocessing data
      1. Binarization
      2. Mean removal
      3. Scaling
      4. Normalization
    4. Label encoding
    5. Logistic regression classifiers
    6. The Naïve Bayes classifier
    7. Confusion matrixes
    8. Support Vector Machines
    9. Classifying income data using Support Vector Machines
    10. What is regression?
    11. Building a single-variable regressor
    12. Building a multivariable regressor
    13. Estimating housing prices using a Support Vector Regressor
    14. Summary
  7. Predictive Analytics with Ensemble Learning
    1. What are decision trees?
      1. Building a decision tree classifier
    2. What is ensemble learning?
      1. Building learning models with ensemble learning
    3. What are random forests and extremely random forests?
      1. Building random forest and extremely random forest classifiers
      2. Estimating the confidence measure of the predictions
    4. Dealing with class imbalance
    5. Finding optimal training parameters using grid search
    6. Computing relative feature importance
    7. Predicting traffic using an extremely random forest regressor
    8. Summary
  8. Detecting Patterns with Unsupervised Learning
    1. What is unsupervised learning?
    2. Clustering data with the K-Means algorithm
      1. Estimating the number of clusters with the Mean Shift algorithm
      2. Estimating the quality of clustering with silhouette scores
    3. What are Gaussian Mixture Models?
      1. Building a classifier based on Gaussian Mixture Models
    4. Finding subgroups in stock market using the Affinity Propagation model
    5. Segmenting the market based on shopping patterns
    6. Summary
  9. Building Recommender Systems
    1. Extracting the nearest neighbors
    2. Building a K-nearest neighbors classifier
    3. Computing similarity scores
    4. Finding similar users using collaborative filtering
    5. Building a movie recommendation system
    6. Summary
  10. Logic Programming
    1. What is logic programming?
    2. Understanding the building blocks of logic programming
    3. Solving problems using logic programming
    4. Installing Python packages
    5. Matching mathematical expressions
    6. Validating primes
    7. Parsing a family tree
    8. Analyzing geography
    9. Building a puzzle solver
    10. Summary
  11. Heuristic Search Techniques
    1. Is heuristic search artificial intelligence?
    2. What is heuristic search?
      1. Uninformed versus informed search
    3. Constraint satisfaction problems
    4. Local search techniques
      1. Simulated annealing
    5. Constructing a string using greedy search
    6. Solving a problem with constraints
    7. Solving the region-coloring problem
    8. Building an 8-puzzle solver
    9. Building a maze solver
    10. Summary
  12. Genetic Algorithms and Genetic Programming
    1. The evolutionists tribe
    2. Understanding evolutionary and genetic algorithms
    3. Fundamental concepts in genetic algorithms
    4. Generating a bit pattern with predefined parameters
    5. Visualizing the evolution
    6. Solving the symbol regression problem
    7. Building an intelligent robot controller
    8. Genetic programming use cases
    9. Summary
    10. References
  13. Artificial Intelligence on the Cloud
    1. Why are companies migrating to the cloud?
    2. The top cloud providers
    3. Amazon Web Services (AWS)
      1. Amazon SageMaker
      2. Alexa, Lex, and Polly – conversational gents
      3. Amazon Comprehend – natural language processing
      4. Amazon Rekognition – image and video
      5. Amazon Translate
      6. Amazon Machine Learning
      7. Amazon Transcribe – transcription
      8. Amazon Textract – document analysis
    4. Microsoft Azure
      1. Microsoft Azure Machine Learning Studio
      2. Azure Machine Learning Service
      3. Azure Cognitive Services
    5. Google Cloud Platform (GCP)
      1. AI Hub
      2. Google Cloud AI Building Blocks
    6. Summary
  14. Building Games with Artificial Intelligence
    1. Using search algorithms in games
    2. Combinatorial search
      1. The Minimax algorithm
      2. Alpha-Beta pruning
      3. The Negamax algorithm
    3. Installing the easyAI library
    4. Building a bot to play Last Coin Standing
    5. Building a bot to play Tic-Tac-Toe
    6. Building two bots to play Connect Four™ against each other
    7. Building two bots to play Hexapawn against each other
    8. Summary
  15. Building a Speech Recognizer
    1. Working with speech signals
    2. Visualizing audio signals
    3. Transforming audio signals to the frequency domain
    4. Generating audio signals
    5. Synthesizing tones to generate music
    6. Extracting speech features
    7. Recognizing spoken words
    8. Summary
  16. Natural Language Processing
    1. Introduction and installation of packages
    2. Tokenizing text data
    3. Converting words to their base forms using stemming
    4. Converting words to their base forms using lemmatization
    5. Dividing text data into chunks
    6. Extracting the frequency of terms using the Bag of Words model
    7. Building a category predictor
    8. Constructing a gender identifier
    9. Building a sentiment analyzer
    10. Topic modeling using Latent Dirichlet Allocation
    11. Summary
  17. Chatbots
    1. The future of chatbots
    2. Chatbots today
    3. Chatbot concepts
    4. A well-architected chatbot
    5. Chatbot platforms
    6. Creating a chatbot using DialogFlow
      1. DialogFlow setup
      2. Integrating a chatbot into a website using a widget
      3. Integrating a chatbot into a website using Python
      4. How to set up a webhook in DialogFlow
      5. Enabling webhooks for intents
      6. Setting up training phrases for an intent
      7. Setting up parameters and actions for an intent
      8. Building fulfillment responses from a webhook
      9. Checking responses from a webhook
    7. Summary
  18. Sequential Data and Time Series Analysis
    1. Understanding sequential data
    2. Handling time series data with Pandas
    3. Slicing time series data
    4. Operating on time series data
    5. Extracting statistics from time series data
    6. Generating data using Hidden Markov Models
    7. Identifying alphabet sequences with Conditional Random Fields
    8. Stock market analysis
    9. Summary
  19. Image Recognition
    1. Importance of image recognition
    2. OpenCV
    3. Frame differencing
    4. Tracking objects using color spaces
    5. Object tracking using background subtraction
    6. Building an interactive object tracker using the CAMShift algorithm
    7. Optical flow-based tracking
    8. Face detection and tracking
      1. Using Haar cascades for object detection
      2. Using integral images for feature extraction
    9. Eye detection and tracking
    10. Summary
  20. Neural Networks
    1. Introduction to neural networks
      1. Building a neural network
      2. Training a neural network
    2. Building a Perceptron-based classifier
    3. Constructing a single-layer neural network
    4. Constructing a multi-layer neural network
    5. Building a vector quantizer
    6. Analyzing sequential data using recurrent neural networks
    7. Visualizing characters in an optical character recognition database
    8. Building an optical character recognition engine
    9. Summary
  21. Deep Learning with Convolutional Neural Networks
    1. The basics of Convolutional Neural Networks
    2. Architecture of CNNs
      1. CNNs vs. perceptron neural networks
    3. Types of layers in a CNN
    4. Building a perceptron-based linear regressor
    5. Building an image classifier using a single-layer neural network
    6. Building an image classifier using a Convolutional Neural Network
    7. Summary
    8. Reference
  22. Recurrent Neural Networks and Other Deep Learning Models
    1. The basics of Recurrent Neural Networks
      1. Step function
      2. Sigmoid function
      3. Tanh function
      4. ReLU function
    2. Architecture of RNNs
    3. A language modeling use case
    4. Training an RNN
    5. Summary
  23. Creating Intelligent Agents with Reinforcement Learning
    1. Understanding what it means to learn
    2. Reinforcement learning versus supervised learning
    3. Real-world examples of reinforcement learning
    4. Building blocks of reinforcement learning
    5. Creating an environment
    6. Building a learning agent
    7. Summary
  24. Artificial Intelligence and Big Data
    1. Big data basics
      1. Crawling
      2. Indexing
      3. Ranking
      4. Worldwide datacenters
      5. Distributed lookups
      6. Custom software
    2. The three V's of big data
      1. Volume
      2. Velocity
      3. Variety
    3. Big data and machine learning
      1. Apache Hadoop
        1. MapReduce
        2. Apache Hive
      2. Apache Spark
        1. Resilient distributed datasets
        2. DataFrames
        3. SparkSQL
      3. Apache Impala
    4. NoSQL Databases
      1. Types of NoSQL databases
      2. Apache Cassandra
      3. MongoDB
      4. Redis
      5. Neo4j
    5. Summary
  25. Other Books You May Enjoy
  26. Index

Product information

  • Title: Artificial Intelligence with Python - Second Edition
  • Author(s): Alberto Artasanchez, Prateek Joshi
  • Release date: January 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781839219535