Ai Chapter 5
Ai Chapter 5
LEARNING
1
OUTLINE
1. Learning
3. Inductive learning
4. Decision trees
5. Neural Networks
2
INTRODUCTION TO LEARNING
Machine Learning is an application of Artificial Intelligence (AI) which enables a
program(software) to learn from the experiences and improve their self at a task
without being explicitly programmed. Machine learning was introduced by
Arthur Samuel in 1959.
Machine Learning is the study of making machines more human-like in their
behavior and decision making by giving them the ability to learn with minimum
human intervention, i.e., no explicit programming.
To any software (program) to attain any experience and learn data is the main
requirement. Data is also called the fuel for Machine Learning and we can safely
say that there is no machine learning without data.
3
INTRODUCTION TO LEARNING
In ML, when agents are exposed to new data, they learn, grow, change, and
develop by themselves.
Machine learning involves finding insightful information without being told
where to look. Instead, they do this by leveraging algorithms that learn from data
in an iterative process.
The main focus of machine learning is to allow the computers learn automatically
instruction or some direct experiences. Then on the basis of this input, machine
makes better decision by looking for some patterns in data.
4
INTRODUCTION TO LEARNING
Machine Learning: Data and output is run on the computer to create a program.
Machine learning is like farming or gardening. Seeds are the algorithms, nutrients
are the data, the gardener is you and plants are the programs.
5
HOW CAN MACHINE LEARN?
The Machine Learning process starts with inputting training data into the selected
algorithm. New input data is fed into the machine learning algorithm to test
whether the algorithm works correctly. The prediction and results are then
checked against each other.
If the prediction and results don’t match, the algorithm is re-trained multiple
times until it gets the desired outcome. This enables the machine learning
algorithm to continually learn on its own and produce the optimal answer,
gradually increasing in accuracy over time.
The accuracy of these models would depend on the quality and amount of input
data. A large amount of data will help build a better model which predicts the
output more accurately. 6
Cont.…
Formally, a computer program is said to learn from experience E with respect
• Task T
• Experience E, and
• Performance measure P
7
LEARNING COMPONENTS
The learning system consists of the following components:
Learning rules: Which update the model parameters with new experience
such that the performance measures with respect to the goals is optimized
8
LEARNING PROBLEM
Spam filtering for emails learning problem
A spam filter is software that detects unsolicited and undesired email and
E: train the system with as many datasets of varied facial photos as possible.
9
MACHINE LEARNING TYPES
AI machine learning models can be classified as:
Supervised Learning
Unsupervised Learning
Reinforcement Learning
10
SUPERVISED LEARNING
Supervised Learning: we use known or labeled data for the training. Since
the data is known, the learning is, therefore, supervised, i.e., directed into
successful execution. Once the model is trained based on the known data, you can
use unknown data into the model and get a new response.
AI algorithms.
11
SUPERVISED LEARNING
Example: the model tries to figure out whether the data is an apple or another
fruit. Once the model has been trained well, it will identify that the data is an
apple and give the desired response.
12
SUPERVISED LEARNING
In Supervised Learning, we have two sets of variables called the target variable,
features and then the program is able to find the underlying pattern in the data.
Take this example of the dataset where we want to predict the price of the house
given its size. The price which is a target variable depends upon the size which is
a feature.
Number of • Input variables (x), and an output variable (y).
Price
rooms
• An algorithm identifies the mapping function
1 $100
between the input and output variables.
3 $300
• The relationship is y = f(x).
5 $500
13
SUPERVISED LEARNING
We can group the supervised learning problems as:
Regression problems: used to predict future values and the model is trained
with the historical data. Regression algorithms are used to predict the
continuous values such as, salary, age, Predicting the future price of a house.
Classification problems: various labels train the algorithm to identify items
15
SUPERVISED LEARNING
Difference between regression and classification algorithm.
The output variable must be of continuous The output variable must be a discrete value.
nature. Used with continuous data (data that Used with discrete data.
can take any value).
The task is to map the input value (x) with the The task is to map the input value(x) with
continuous output variable(y). the discrete output variable(y).
Find the best fit line, which can predict the Find the decision boundary, which can
output more accurately. divide the dataset into different classes.
There are many algorithm for regression and classification problems. Some of
16
SUPERVISED LEARNING
Types of algorithm
17
SUPERVISED LEARNING: CLASSIFICATION
Classification Algorithms can be further divided into two category:
Linear Models
Logistic Regression
Non-linear Models
K-Nearest Neighbors
Kernel SVM
Naïve Bayes
18
EXERCISE
Example: Suppose there is a marketing company A, who does various
advertisement every year and get sales on that. The below list shows the
advertisement made by the company in the last 5 years and the corresponding
sales:
Advertisement Sales Advertisement Sales
90 1000 90 Low
120 1500 120 Medium
150 2000 150 High
100 1300 100 Medium
130 1600 130 High
200 ?? 200 ??
supervised using training dataset. Instead, models itself find the hidden patterns
and insights from the given data. It can be compared to learning which takes
20
UNSUPERVISED LEARNING
Unsupervised approach is the one where we have no target variables, and we
have only the input variable(features) at hand. The algorithm learns by itself and
underlying distribution in the data to gain more knowledge about the data.
Clustering: this means bundling the input variables with the same
the data set. E.g., People who watch ‘X’ will also watch ‘Y’. 21
UNSUPERVISED LEARNING
Some example of unsupervised learning algorithms:
K-means clustering
22
REINFORCEMENT LEARNING
Reinforcement Learning: works on a feedback-based process, in which an
agent automatically explore its surrounding by trail, taking action, learning from
experiences, and improving its performance.
Agent gets rewarded for each good action and get punished for each bad action;
It increases the tendency that the specific behavior would occur again by
avoiding the negative condition. 23
NEURAL NETWORKS
The term Artificial neural network refers to a biologically inspired sub-field of
human brain so that computers will have an option to understand things and
neural networks also have neurons that are linked to each other in various layers
of fine structures called dendrites, neuron sends out spikes of electrical activity
through a long, thin stand known as an axon, synapse converts the activity from
the axon into electrical effects to the connected neurons.
25
ARTIFICIAL NEURAL NETWORKS : PERCEPTRON
Perceptron: it consists of a single neuron with multiple inputs and a single output.
26
ANN: MULTILAYER PERCEPTRON
Multilayer Perceptron: consists of more than one perception which is grouped
27
LEARNING IN ANN
Learning a perceptron means finding the right values for W.
a. Yes. Quit
28
LEARNING IN ANN
Learning means minimizing the error term. In the Neural Network, we take the
computed loss value back to each layer so that it updates the weights in such a
This way of first adjusting the weights in the output is known as Backward
Propagation. On the other hand, the process of going from left to right i.e from
the Input layer to the Output Layer for the adjustment is known as the Forward
Propagation.
29
LEARNING IN ANN
Forward Propagation is the way to move from the Input layer (left) to the
Output layer (right) in the neural network. The process of moving from the
right to left i.e backward from the Output to the Input layer is called the
Backward Propagation.
30
DEEP LEARNING
It is a subfield of Machine Learning, inspired by the biological neurons of a
brain. Most deep learning methods use neural network architectures, which is
why deep learning models are often referred to as deep neural networks.
Deep learning algorithms work with almost any kind of data and require large
network. Traditional neural networks only contain 2-3 hidden layers, while deep
networks can have as many as 150.
32
DEEP LEARNING
33
DEEP LEARNING
The most popular deep learning algorithms are:
Autoencoders
34
DEEP LEARNING
Convolutional Neural Networks (CNNs): also known as ConvNets, consist of
multiple layers and are mainly used for image processing and object detection.
Yann LeCun developed the first CNN in 1988 when it was called LeNet.
CNN's are widely used to identify satellite images, process medical images,
35
DEEP LEARNING
Recurrent Neural Networks(RNNs): consist of some directed connections that
form a cycle that allow the output provided to be used as input in the current
phase of RNNs. RNNs are mostly used in captioning the image, time series
analysis, recognizing handwritten data, and translating data to machines.
36
DEEP LEARNING
LSTMs are a type of Recurrent Neural Network (RNN) that can learn and
37
GENERALIZATION AND OVERFITTING
The cause of poor performance in machine learning is either overfitting or
The situation where any given model is performing too well on the training data
but the performance drops significantly over the test set is called an over fitting
data.
If the model is performing poorly over the test and the train set, then we call that
39
GENERALIZATION AND OVERFITTING
40
GENERALIZATION AND OVERFITTING
41
APPLICATIONS OF NEURAL NETWORKS
Neural networks have broad applicability to real world business problems. They
have already been successfully applied in many industries. Since neural networks
are best at identifying patterns or trends in data, they are well suited for
prediction or forecasting needs including:
hard to model using classical techniques. These include, computer vision, NLP,
path planning and etc.
42
APPLICATIONS OF NEURAL NETWORKS
Recently, learning is widely used in a number of application areas including,
• Autonomous vehicles/robots
43
MACHINES INTELLIGENCE
In the world of AI, for a machine to be considered intelligent, it must pass the
Turing Test.
A test developed by Alan Turing in the 1950s, which competes humans against
the machine.
To pass the test, a human evaluator will interact with a machine and another
generated by the machine and the other human, then the machine passes the test
and is considered to be exhibiting “intelligent” behavior.
44
THE END
?
45