artificial intelligence with python tutorial

Telechargé par Ilyes Khelili
AI with Python
i
l
AI with Python
i
About the Tutorial
Artificial intelligence is the intelligence demonstrated by machines, in contrast to the
intelligence displayed by humans.
This tutorial covers the basic concepts of various fields of artificial intelligence like Artificial
Neural Networks, Natural Language Processing, Machine Learning, Deep Learning, Genetic
algorithms etc., and its implementation in Python.
Audience
This tutorial will be useful for graduates, post graduates, and research students who either
have an interest in this subject or have this subject as a part of their curriculum. The
reader can be a beginner or an advanced learner.
Prerequisites
We assume that the reader has basic knowledge about Artificial Intelligence and Python
programming. He/she should be aware about basic terminologies used in AI along with
some useful python packages like nltk, OpenCV, pandas, OpenAI Gym, etc.
Copyright & Disclaimer
Copyright 2016 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent
of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our
website or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at contact@tutorialspoint.com
AI with Python
ii
Table of Contents
About the Tutorial ............................................................................................................................................ i
Audience ........................................................................................................................................................... i
Prerequisites ..................................................................................................................................................... i
Copyright & Disclaimer ..................................................................................................................................... i
Table of Contents ............................................................................................................................................ ii
1. AI with Python Primer Concepts ............................................................................................................. 1
Basic Concept of Artificial Intelligence (AI) ...................................................................................................... 1
The Necessity of Learning AI ........................................................................................................................... 1
What is Intelligence? ....................................................................................................................................... 2
What is Intelligence Composed Of? ................................................................................................................ 3
Learning − l ...................................................................................................................................................... 4
What’s Involved in AI ....................................................................................................................................... 6
Application of AI .............................................................................................................................................. 6
Cognitive Modeling: Simulating Human Thinking Procedure .......................................................................... 7
Agent & Environment ...................................................................................................................................... 8
2. AI with Python Getting Started .............................................................................................................. 9
Why Python for AI ........................................................................................................................................... 9
Features of Python .......................................................................................................................................... 9
Installing Python ............................................................................................................................................ 10
Setting up PATH ............................................................................................................................................. 11
Running Python ............................................................................................................................................. 12
Script from the Command-line ...................................................................................................................... 13
Integrated Development Environment ......................................................................................................... 13
3. AI with Python Machine Learning ........................................................................................................ 15
Types of Machine Learning (ML) ................................................................................................................... 15
Most Common Machine Learning Algorithms ............................................................................................... 16
AI with Python
iii
4. AI with Python Data Preparation ......................................................................................................... 20
Preprocessing the Data ................................................................................................................................. 20
Techniques for Data Preprocessing ............................................................................................................... 21
Labeling the Data ........................................................................................................................................... 23
5. AI with Python Supervised Learning: Classification .............................................................................. 26
Steps for Building a Classifier in Python ........................................................................................................ 26
Building Classifier in Python .......................................................................................................................... 29
Logistic Regression ........................................................................................................................................ 34
Decision Tree Classifier .................................................................................................................................. 37
Random Forest Classifier ............................................................................................................................... 39
Performance of a classifier ............................................................................................................................ 40
Class Imbalance Problem ............................................................................................................................... 42
Ensemble Techniques .................................................................................................................................... 43
6. AI with Python Supervised Learning: Regression .................................................................................. 44
Building Regressors in Python ....................................................................................................................... 44
7. AI with Python Logic Programming ...................................................................................................... 49
How to Solve Problems with Logic Programming.......................................................................................... 49
Installing Useful Packages ............................................................................................................................. 50
Examples of Logic Programming ................................................................................................................... 50
Checking for Prime Numbers ......................................................................................................................... 51
Solving Puzzles ............................................................................................................................................... 52
8. AI with Python Unsupervised Learning: Clustering ............................................................................... 55
What is Clustering? ........................................................................................................................................ 55
Algorithms for Clustering the Data ................................................................................................................ 55
Measuring the Clustering Performance ........................................................................................................ 61
Calculating Silhouette Score .......................................................................................................................... 61
Finding Nearest Neighbors ............................................................................................................................ 63
K-Nearest Neighbors Classifier ...................................................................................................................... 65
AI with Python
iv
9. AI with Python Natural Language Processing ....................................................................................... 69
Components of NLP ....................................................................................................................................... 69
Difficulties in NLU .......................................................................................................................................... 69
NLP Terminology ........................................................................................................................................... 70
Steps in NLP ................................................................................................................................................... 70
10. AI with Python NLTK package .............................................................................................................. 72
Importing NLTK .............................................................................................................................................. 72
Downloading NLTK’s Data ............................................................................................................................. 72
Installing Other Necessary Packages ............................................................................................................. 73
Concept of Tokenization, Stemming, and Lemmatization ............................................................................. 73
Chunking: Dividing Data into Chunks ............................................................................................................ 75
Types of chunking .......................................................................................................................................... 76
Bag of Word (BoW) Model ............................................................................................................................ 77
Concept of the Statistics ................................................................................................................................ 78
Building a Bag of Words Model in NLTK ........................................................................................................ 79
Solving Problems ........................................................................................................................................... 79
Topic Modeling: Identifying Patterns in Text Data ........................................................................................ 84
Algorithms for Topic Modeling ...................................................................................................................... 84
11. AI with Python Analyzing Time Series Data .......................................................................................... 86
Introduction ................................................................................................................................................... 86
Installing Useful Packages ............................................................................................................................. 86
Pandas: Handling, Slicing and Extracting Statistic from Time Series Data ..................................................... 87
Extracting Statistic from Time Series Data .................................................................................................... 91
Analyzing Sequential Data by Hidden Markov Model (HMM)....................................................................... 95
Example: Analysis of Stock Market data........................................................................................................ 96
12. AI with Python Speech Recognition ...................................................................................................... 99
Building a Speech Recognizer ........................................................................................................................ 99
Visualizing Audio Signals - Reading from a File and Working on it .............................................................. 100
1 / 164 100%

artificial intelligence with python tutorial

Telechargé par Ilyes Khelili
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans linterface ou les textes ? Ou savez-vous comment améliorer linterface utilisateur de StudyLib ? Nhésitez pas à envoyer vos suggestions. Cest très important pour nous !