Build real-world Artificial Intelligence applications with Python to intelligently interact with the world around you About This Book - Step into the amazing world of intelligent apps using this comprehensive guide - Enter the world of Artificial Intelligence, explore it, and create your own applications - Work through simple yet insightful examples that will get you up and running with Artificial Intelligence in no time Who This Book Is For This book is for Python developers who want to build real-world Artificial Intelligence applications. This book is friendly to Python beginners, but being familiar with Python would be useful to play around with the code. It will also be useful for experienced Python programmers who are looking to use Artificial Intelligence techniques in their existing technology stacks. What You Will Learn - Realize different classification and regression techniques - Understand the concept of clustering and how to use it to automatically segment data - See how to build an intelligent recommender system - Understand logic programming and how to use it - Build automatic speech recognition systems - Understand the basics of heuristic search and genetic programming - Develop games using Artificial Intelligence - Learn how reinforcement learning works - Discover how to build intelligent applications centered on images, text, and time series data - See how to use deep learning algorithms and build applications based on it In Detail Artificial Intelligence is becoming increasingly relevant in the modern world where everything is driven by technology and data. It is used extensively across many fields such as search engines, image recognition, robotics, finance, and so on. We will explore various real-world scenarios in this book and you'll learn about various algorithms that can be used to build Artificial Intelligence applications. During the course of this book, you will find out how to make informed decisions about what algorithms to use in a given context. Starting from the basics of Artificial Intelligence, you will learn how to develop various building blocks using different data mining techniques. You will see how to implement different algorithms to get the best possible results, and will understand how to apply them to real-world scenarios. If you want to add an intelligence layer to any application that's based on images, text, stock market, or some other form of data, this exciting book on Artificial Intelligence will definitely be your guide! Style and approach This highly practical book will show you how to implement Artificial Intelligence. The book provides multiple examples enabling you to create smart applications to meet the needs of your organization. In every chapter, we explain an algorithm, implement it, and then build a smart application.
Author(s): Prateek Joshi
Publisher: Packt Publishing
Year: 2017
Language: English
Tags: AI, machine learning, computer science, programming, coding
Contents
Preface
Intro to Artificial Intelligence
What is Artificial Intelligence?
Why do we need to study AI?
Applications of AI
Branches of AI
Defining intelligence using Turing Test
Making machines think like humans
Building rational agents
General Problem Solver
Building an intelligent agent
Installing Python 3
Installing packages
Loading data
Summary
Classification & Regression using Supervised Learning
Supervised versus unsupervised learning
What is classification?
Preprocessing data
Label encoding
Logistic Regression classifier
Naïve Bayes classifier
Confusion matrix
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 is Ensemble Learning?
What are Decision Trees?
What are Random Forests and Extremely Random Forests?
Dealing with class imbalance
Finding optimal training parameters using grid search
Computing relative feature importance
Predicting traffic using Extremely Random Forest regressor
Summary
Detecting Patterns with Unsupervised Learning
What is unsupervised learning?
Clustering data with K-Means algorithm
Estimating the number of clusters with 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 Affinity Propagation model
Segmenting the market based on shopping patterns
Summary
Building Recommender Systems
Creating a training pipeline
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
What is heuristic search?
Constraint Satisfaction Problems
Local search techniques
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
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
Summary
Games with Artificial Intelligence
Using search algorithms in games
Combinatorial search
Minimax algorithm
Alpha-Beta pruning
Negamax algorithm
Installing 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
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 a Bag of Words model
Building a category predictor
Constructing a gender identifier
Building a sentiment analyzer
Topic modeling using Latent Dirichlet Allocation
Summary
Probabilistic Reasoning for Sequential Data
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
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
Object Detection & Tracking
Installing OpenCV
Frame differencing
Tracking objects using colorspaces
Object tracking using background subtraction
Building an interactive object tracker using the CAMShift algorithm
Optical flow based tracking
Face detection and tracking
Eye detection and tracking
Summary
Artificial Neural Networks
Introduction to artificial neural networks
Building a Perceptron based classifier
Constructing a single layer neural network
Constructing a multilayer 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
Reinforcement Learning
Understanding the premise
Reinforcement learning versus supervised learning
Real world examples of reinforcement learning
Building blocks of reinforcement learning
Creating an environment
Building a learning agent
Summary
Deep Learning with Convolutional NNs
What are Convolutional Neural Networks?
Architecture of CNNs
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
Index