Artificial Intelligence and Machine Learning Fundamentals

Book Description

Create AI applications in Python and lay the foundations for your career in data science

Key Features

  • Practical examples that explain key machine learning algorithms
  • Explore neural networks in detail with interesting examples
  • Master core AI concepts with engaging activities

Book Description

Machine learning and neural networks are pillars on which you can build intelligent applications. Artificial Intelligence and Machine Learning Fundamentals begins by introducing you to Python and discussing AI search algorithms. You will cover in-depth mathematical topics, such as regression and classification, illustrated by Python examples.

As you make your way through the book, you will progress to advanced AI techniques and concepts, and work on real-life datasets to form decision trees and clusters. You will be introduced to neural networks, a powerful tool based on Moore's law.

By the end of this book, you will be confident when it comes to building your own AI applications with your newly acquired skills!

What you will learn

  • Understand the importance, principles, and fields of AI
  • Implement basic artificial intelligence concepts with Python
  • Apply regression and classification concepts to real-world problems
  • Perform predictive analysis using decision trees and random forests
  • Carry out clustering using the k-means and mean shift algorithms
  • Understand the fundamentals of deep learning via practical examples

Who this book is for

Artificial Intelligence and Machine Learning Fundamentals is for software developers and data scientists who want to enrich their projects with machine learning. You do not need any prior experience in AI. However, it's recommended that you have knowledge of high school-level mathematics and at least one programming language (preferably Python).

Publisher Resources

Download Example Code

Table of Contents

  1. Preface
    1. About the Book
      1. About the Author
      2. Objectives
      3. Audience
      4. Approach
      5. Minimum Hardware Requirements
      6. Software Requirements
      7. Conventions
      8. Installation and Setup
      9. Starting Anaconda
      10. Additional Resources
  2. Principles of Artificial Intelligence
    1. Introduction
      1. How does AI Solve Real World Problems?
      2. Diversity of Disciplines
    2. Fields and Applications of Artificial Intelligence
      1. Simulating Intelligence – The Turing Test
    3. AI Tools and Learning Models
      1. Classification and Prediction
      2. Learning Models
    4. The Role of Python in Artificial Intelligence
      1. Why is Python Dominant in Machine Learning, Data Science, and AI?
      2. Anaconda in Python
      3. Python Libraries for Artificial Intelligence
      4. A Brief Introduction to the NumPy Library
      5. Exercise 1: Matrix Operations Using NumPy
    5. Python for Game AI
      1. Intelligent Agents in Games
      2. Breadth First Search and Depth First Search
      3. Exploring the State Space of a Game
      4. Exercise 2: Estimating the Number of Possible States in Tic-Tac-Toe Game
      5. Exercise 3: Creating an AI Randomly
      6. Activity 1: Generating All Possible Sequences of Steps in a Tic-Tac-Toe Game
    6. Summary
  3. AI with Search Techniques and Games
    1. Introduction
      1. Exercise 4: Teaching the Agent to Win
      2. Activity 2: Teaching the Agent to Realize Situations When It Defends Against Losses
      3. Activity 3: Fixing the First and Second Moves of the AI to Make it Invincible
    2. Heuristics
      1. Uninformed and Informed Search
      2. Creating Heuristics
      3. Admissible and Non-Admissible Heuristics
      4. Heuristic Evaluation
      5. Exercise 5: Tic-Tac-Toe Static Evaluation with a Heuristic Function
      6. Using Heuristics for an Informed Search
      7. Types of Heuristics
    3. Pathfinding with the A* Algorithm
      1. Exercise 6: Finding the Shortest Path to Reach a Goal
      2. Exercise 7: Finding the Shortest Path Using BFS
      3. Introducing the A* Algorithm
      4. A* Search in Practice Using the simpleai Library
    4. Game AI with the Minmax Algorithm and Alpha-Beta Pruning
      1. Search Algorithms for Turn-Based Multiplayer Games
      2. The Minmax Algorithm
      3. Optimizing the Minmax Algorithm with Alpha-Beta Pruning
      4. DRYing up the Minmax Algorithm – The NegaMax Algorithm
      5. Using the EasyAI Library
      6. Activity 4: Connect Four
    5. Summary
  4. Regression
    1. Introduction
    2. Linear Regression with One Variable
      1. What Is Regression?
      2. Features and Labels
      3. Feature Scaling
      4. Cross-Validation with Training and Test Data
      5. Fitting a Model on Data with scikit-learn
      6. Linear Regression Using NumPy Arrays
      7. Fitting a Model Using NumPy Polyfit
      8. Predicting Values with Linear Regression
      9. Activity 5: Predicting Population
    3. Linear Regression with Multiple Variables
      1. Multiple Linear Regression
      2. The Process of Linear Regression
      3. Importing Data from Data Sources
      4. Loading Stock Prices with Yahoo Finance
      5. Loading Files with pandas
      6. Loading Stock Prices with Quandl
      7. Exercise 8: Using Quandl to Load Stock Prices
      8. Preparing Data for Prediction
      9. Performing and Validating Linear Regression
      10. Predicting the Future
    4. Polynomial and Support Vector Regression
      1. Polynomial Regression with One Variable
      2. Exercise 9: 1st, 2nd, and 3rd Degree Polynomial Regression
      3. Polynomial Regression with Multiple Variables
      4. Support Vector Regression
      5. Support Vector Machines with a 3 Degree Polynomial Kernel
      6. Activity 6: Stock Price Prediction with Quadratic and Cubic Linear Polynomial Regression with Multiple Variables
    5. Summary
  5. Classification
    1. Introduction
    2. The Fundamentals of Classification
      1. Exercise 10: Loading Datasets
      2. Data Preprocessing
      3. Exercise 11: Pre-Processing Data
      4. Minmax Scaling of the Goal Column
      5. Identifying Features and Labels
      6. Cross-Validation with scikit-learn
      7. Activity 7: Preparing Credit Data for Classification
      8. The k-nearest neighbor Classifier
      9. Introducing the K-Nearest Neighbor Algorithm
      10. Distance Functions
      11. Exercise 12: Illustrating the K-nearest Neighbor Classifier Algorithm
      12. Exercise 13: k-nearest Neighbor Classification in scikit-learn
      13. Exercise 14: Prediction with the k-nearest neighbors classifier
      14. Parameterization of the k-nearest neighbor Classifier in scikit-learn
      15. Activity 8: Increasing the Accuracy of Credit Scoring
    3. Classification with Support Vector Machines
      1. What are Support Vector Machine Classifiers?
      2. Understanding Support Vector Machines
      3. Support Vector Machines in scikit-learn
      4. Parameters of the scikit-learn SVM
      5. Activity 9: Support Vector Machine Optimization in scikit-learn
    4. Summary
  6. Using Trees for Predictive Analysis
    1. Introduction to Decision Trees
      1. Entropy
      2. Exercise 15: Calculating the Entropy
      3. Information Gain
      4. Gini Impurity
      5. Exit Condition
      6. Building Decision Tree Classifiers using scikit-learn
      7. Evaluating the Performance of Classifiers
      8. Exercise 16: Precision and Recall
      9. Exercise 17: Calculating the F1 Score
      10. Confusion Matrix
      11. Exercise 18: Confusion Matrix
      12. Activity 10: Car Data Classification
    2. Random Forest Classifier
      1. Constructing a Random Forest
      2. Random Forest Classification Using scikit-learn
      3. Parameterization of the random forest classifier
      4. Feature Importance
      5. Extremely Randomized Trees
      6. Activity 11: Random Forest Classification for Your Car Rental Company
    3. Summary
  7. Clustering
    1. Introduction to Clustering
      1. Defining the Clustering Problem
      2. Clustering Approaches
      3. Clustering Algorithms Supported by scikit-learn
    2. The k-means Algorithm
      1. Exercise 19: k-means in scikit-learn
      2. Parameterization of the k-means Algorithm in scikit-learn
      3. Exercise 20: Retrieving the Center Points and the Labels
      4. k-means Clustering of Sales Data
      5. Activity 12: k-means Clustering of Sales Data
    3. Mean Shift Algorithm
      1. Exercise 21: Illustrating Mean Shift in 2D
      2. Mean Shift Algorithm in scikit-learn
      3. Image Processing in Python
      4. Activity 13: Shape Recognition with the Mean Shift Algorithm
    4. Summary
  8. Deep Learning with Neural Networks
    1. Introduction
    2. TensorFlow for Python
      1. Installing TensorFlow in the Anaconda Navigator
      2. TensorFlow Operations
      3. Exercise 22: Using Basic Operations and TensorFlow constants
      4. Placeholders and Variables
      5. Global Variables Initializer
    3. Introduction to Neural Networks
      1. Biases
      2. Use Cases for Artificial Neural Networks
      3. Activation Functions
      4. Exercise 23: Activation Functions
      5. Forward and Backward Propagation
      6. Configuring a Neural Network
      7. Importing the TensorFlow Digit Dataset
      8. Modeling Features and Labels
      9. TensorFlow Modeling for Multiple Labels
      10. Optimizing the Variables
      11. Training the TensorFlow Model
      12. Using the Model for Prediction
      13. Testing the Model
      14. Randomizing the Sample Size
      15. Activity 14: Written Digit Detection
    4. Deep Learning
      1. Adding Layers
      2. Convolutional Neural Networks
      3. Activity 15: Written Digit Detection with Deep Learning
    5. Summary
  9. Appendix
    1. Chapter 1: Principles of AI
      1. Activity 1: Generating All Possible Sequences of Steps in the tic-tac-toe Game
    2. Chapter 2: AI with Search Techniques and Games
      1. Activity 2: Teach the agent realize situations when it defends against losses
      2. Activity 3: Fix the first and second moves of the AI to make it invincible
      3. Activity 4: Connect Four
      4. Chapter 3: Regression
      5. Activity 5: Predicting Population
      6. Activity 6: Stock Price Prediction with Quadratic and Cubic Linear Polynomial Regression with Multiple Variables
    3. Chapter 4: Classification
      1. Activity 7: Preparing Credit Data for Classification
      2. Activity 8: Increase the accuracy of credit scoring
      3. Activity 9: Support Vector Machine Optimization in scikit-learn
    4. Chapter 5: Using Trees for Predictive Analysis
      1. Activity 10: Car Data Classification
      2. Activity 11: Random Forest Classification for your Car Rental Company
    5. Chapter 6: Clustering
      1. Activity 12: k-means Clustering of Sales Data
      2. Activity 13: Shape Recognition with the Mean Shift algorithm
    6. Chapter 7: Deep Learning with Neural Networks
      1. Activity 14: Written digit detection
      2. Activity 15 : Written Digit Detection with Deep Learning

Product Information

  • Title: Artificial Intelligence and Machine Learning Fundamentals
  • Author(s): Zsolt Nagy
  • Release date: December 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789801651