Ch-2 Advanced Concepts of Modeling in AI
Ch-2 Advanced Concepts of Modeling in AI
png
WALT:
➢ To familiarize students with supervised, unsupervised and reinforcement learning
based approach.
➢ To Introduce students to the neural network.
Success Criteria:
Students will be able to:
➢ Understand supervised, unsupervised and reinforcement learning based
approach.
➢ Understand Neural Networks.
preencoded.png
2.1 Revisiting AI, ML, DL
To build an AI based project, we need to work around Artificially Intelligent models or algorithms. This could be done
either by designing your own model or by using the pre-existing AI models. Before jumping into modelling let us
clarify the definitions of Artificial Intelligence (AI), Machine Learning (ML) and Deep Learning (DL).
preencoded.png
Differentiate between AI, ML, and DL
Purpose: Say: Artificial Intelligence (AI):
To differentiate between Artificial Intelligence (AI), "As we enter the world of modelling, it is a good Refers to any technique that enables computers
Machine Learning (ML) and Deep Learning (DL). time to clarify something many of you may be to mimic human intelligence. An artificially
having doubts about. You may have heard the intelligent machine works on algorithms and data
terms AI, ML and DL when research content online fed to it and gives the desired output.
and during this course. They are of course related,
but how?"
Venn Diagram:
Artificial Intelligence covers machine and deep learning. Deep Learning is under Machine Learning. It's a funnel approach with various applications of AI, some under
ML, and a few into DL.
preencoded.png
preencoded.png
Machine Learning (ML)
Machine Learning, or ML, enables machines to improve at tasks with experience. The machine
learns from its mistakes and takes them into consideration in the next execution. It improvises
itself using its own experiences.
preencoded.png
preencoded.png
Examples of Machine Learning (ML)
preencoded.png
Deep Learning (DL)
Deep Learning, or DL, enables software to train itself to perform tasks with vast amounts of
data. In deep learning, the machine is trained with huge amounts of data which helps it into
training itself around the data. Such machines are intelligent enough to develop algorithmsfor
themselves. Deep Learning is the most advanced form of Artificial Intelligence out of these
three. Following is the block diagram of deep learning:
preencoded.png
preencoded.png
Examples of Deep Learning (DL)
preencoded.png
Common terminologies
What is Data? used with data
• Data is information in any form
• For e.g. A table with information about fruits is data
• Each row will contain information about different fruits
• Each fruit is described by certain features
The columns of a The name of the The color of the The size of the Any other relevant
data table are called fruit. fruit. fruit. information about the
features. fruit.
preencoded.png
2.2 Modelling
Purpose:
Classification of Models into Rule-based approach and Learning approach.
Say:
"In general, there are two approaches taken by researchers when building AI models. They either take a rule-
based approach or learning approach. A Rule based approach is generally based on the data and rules fed to
the machine, where the machine reacts accordingly to deliver the desired output. Under learning approach, the
machine is fed with data and the desired output to which the machine designs its own algorithm (or set of
rules) to match the data to the desired output fed into the machine"
AI Modelling
Refers to developing algorithms, also called models which can be trained to get intelligent outputs. That is,
writing codes to make a machine artificially intelligent.
preencoded.png
Types of AI Models
Generally, AI models can be classified as follows:
preencoded.png
Rule-Based Approach
preencoded.png
Learning-Based Approach
preencoded.png
Supervised Learning
In a supervised learning model, the dataset which is fed to the machine is labelled. In other words,
we can say that the dataset is known to the person who is training the machine only then he/she
is able to label the data. A label is some information which can be used as a tag for data. For
example, students get grades according to the marks they secure in examinations. These grades
are labels which categorize the students according to their marks.
preencoded.png
Supervised Learning Example
Example
A supermarket collects customer shopping history.
It is supervised learning. Here social media platform is using tagged photos to recognize the person. Therefore, the tagged photos
become the labels of the pictures and we know that when the machine is learning from labeled data, it is supervised learning.
preencoded.png
Case 2: OTT platform Recommendations based on
someone's watch history
It is unsupervised learning. This is what OTT platforms like Netflix, Pandora, and Spotify do all the time; they collect
the songs/movies that you like already, evaluate the features based on your likes/dislikes and then recommend new
movies/songs based on similar features.
preencoded.png
Case 3: Analyze bank data for suspicious-looking
transactions and flag the fraud transactions
It is unsupervised learning. In this case, the suspicious transactions are not defined, hence there are no labels of
"fraud" and "not fraud". The model tries to identify outliers by looking at anomalous transactions and flags them as
'fraud'.
preencoded.png
Supervised Vs. Unsupervised
Learning
Supervised Learning Unsupervised Learning
preencoded.png
What makes it different?
1. For supervised learning and unsupervised learning, you need to have a pretty good idea of the data that you have,
what’s going on, and how to solve the problem.
2. However, you will frequently encounter situations where you have to deal with large complex problem spaces.
3. You may need to respond to unforeseen environments, and you don’t have sufficient data on those specific
scenarios.
4. The environment may change. Hence your system needs to be adaptive. Reinforcement Learning will be important
because it doesn’t require a lot of pre- existing knowledge or data to provide useful solutions.
preencoded.png
Summary of ML Models
• Supervised learning models are used when we want to determine relationships through training.
• Unsupervised learning models are used when we want to discover new patterns from data.
• Reinforcement learning models are used when we want to implement machine learning through a reward mechanism.
preencoded.png
Sub-categories of Supervised Learning Model
There are two types of Supervised Learning models: Classification model and Regression model.
preencoded.png
Classification Model
Here the data is classified according to the labels. For example, in the grading system,
students are classified on the basis of the grades they obtain with respect to their marks in
the examination. This model works on discrete dataset which means the data need not be
continuous.
preencoded.png
Examples of the Classification Model
In this case, the model would be trained on historical weather data that includes temperature information labeled as
"hot" or "cold". The model would learn the patterns that differentiate hot and cold weather based on factors like:
- Location (average temperatures vary geographically), - Season (summer vs. winter),
- High and low temperatures, - Humidity
When presented with weather data for tomorrow, the trained classification model would analyze these factors and
predict the most likely category - "hot" or "cold" weather tomorrow.
preencoded.png
Classifying emails as spam or not:
The model is shown tons of emails, both real ones (like from friends or colleagues) and spam. The model learns
what makes an email look like spam. Once trained, the model sees a new email. It analyzes the clues in the email
and decides: is this spam or not? It assigns a category - "spam" or "not spam" - just like sorting your mail.
In modern-day Email, classifiers identify if the email is spam and have evolved into other
categories such as social, advertisement, notifications, etc. Similar models are increasingly
being used in messaging applications.
preencoded.png
Regression Model
Regression: Such models work on continuous data. For example, if you wish to predict your
next salary, then you would put in the data of your previous salary, any increments, etc., and
would train the model. Here, the data which has been fed to the machine is continuous.
preencoded.png
Examples of the Regression Model
Example 1: Predicting temperature
Temperature is a continuous variable, meaning it can take on any value within a range. Regression models are well-suited for
predicting continuous outputs.
1. [Features/Independent Variables]
1. No of bedrooms
2. Carpet Size
3. Garage Area
2. [Label/Dependent Variable]
1. Price [Label/Dependent Variable]
• In the House Price Prediction Problem, we are trying to predict the price (dependent variable) based on certain parameters like the
number of bedrooms, carpet size, and garage area (independent variables).
This type of model will be of type regression since it will predict an approximate price (continuous value) of the car based on
preencoded.png
It is Classification. Binary Classification; since the model is going to predict whether or not the customer is eligible
for a loan- The output will be either yes or no (discrete values)
It is Regression because predicting weather for next 24 hours will be a continuous range (it will keep changing over
the period of 24 hours)
preencoded.png
Sub-categories of Unsupervised Learning Model
Unsupervised learning models can be further divided into two categories: Clustering model and
Association model.
preencoded.png
What is Clustering?
In this example, we have input data with no class labels (unlabeled data), and this input data
comprises of birds and animals. Note that, even though there were no class labels, the
unsupervised learning model was able to divide this data into two clusters based on clustering.
The two clusters have been formed based on the similarity of characteristics. The first cluster
comprises all the animals, and the second cluster comprises all the birds. preencoded.png
Clustering vs Classification
• Classification uses predefined categories (e.g., Spam or Not Spam).
• Clustering finds similarities and groups objects without predefined labels.
preencoded.png
Based on the purchase pattern of customers A and B, can you
predict any Customer X who buys bread will most probably buy?
Based on the purchase pattern of other customers, we can predict that there is high
probability that any customer x who buys bread will most probably buy butter. Therefore,
such meaningful associations can be useful to recommend items to customers. This is
called Association Rule.
preencoded.png
Summary of detailed
classification of ML models:
preencoded.png
Sub-Categories of Deep Learning
Deep Learning enables software to train itself to perform tasks with vast amounts of data. In deep
learning, the machine is trained with huge amounts of data which helps it to train itself around the
data. Such machines are intelligent enough to develop algorithms for themselves. There are two
types of Deep Learning models: Artificial Neural Networks (ANN) and Convolution Neural Network
(CNN).
preencoded.png
Artificial Neural Networks Convolutional Neural
(ANN) Networks (CNN)
• Modeled on the human brain and • A deep learning algorithm specifically
nervous system. designed for image data.
preencoded.png
2.3 Artificial Neural Networks
Purpose: To understand and experience what a neural network is like.
Neural networks are loosely modelled after how neurons in the human brain behave. The key advantage of neural
networks is that they are able to extract data features automatically without needing the input of the programmer.
A neural network is essentially a system of organizing machine learning algorithms to perform certain tasks. It is a
fast and efficient way to solve problems for which the data set is very large, such as in images.
preencoded.png
What is Neural Network?
Neural networks are inspired by how the human brain works. They help computers learn from large amounts of data
automatically, without being told exactly what to do. They are used to solve complex problems like recognizing images or
speech.
preencoded.png
preencoded.png
preencoded.png
preencoded.png
Mind Map :
Quick Review of the Chapter!
preencoded.png