0% found this document useful (0 votes)
196 views50 pages

Ch-2 Advanced Concepts of Modeling in AI

The document provides an overview of different machine learning approaches, including supervised, unsupervised, and reinforcement learning, along with their definitions and applications. It explains the distinctions between artificial intelligence (AI), machine learning (ML), and deep learning (DL), and categorizes AI models into rule-based and learning-based approaches. Additionally, it details specific types of learning models, such as classification and regression for supervised learning, and clustering and association for unsupervised learning.

Uploaded by

Ganesh Shirva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views50 pages

Ch-2 Advanced Concepts of Modeling in AI

The document provides an overview of different machine learning approaches, including supervised, unsupervised, and reinforcement learning, along with their definitions and applications. It explains the distinctions between artificial intelligence (AI), machine learning (ML), and deep learning (DL), and categorizes AI models into rule-based and learning-based approaches. Additionally, it details specific types of learning models, such as classification and regression for supervised learning, and clustering and association for unsupervised learning.

Uploaded by

Ganesh Shirva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

preencoded.

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?"

Machine Learning (ML): Deep Learning (DL): Relationships:


Enables machines to improve at tasks with Enables software to train itself to perform tasks AI is the umbrella term covering both DL and ML.
experience. The machine learns from new data with vast amounts of data. It utilizes multiple DL is a subset of ML, comprising of multiple ML
fed to it while testing and uses it for the next machine learning algorithms to perform a specific algorithms.
iteration. It also considers exceptions. task.

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)

Digit recognition in deep learning tackles the challenge of training computers


to identify handwritten digits (0-9) within images.

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

What are Name Color Size Other


Features? Info

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.

• Columns of the tables are called features


• In the fruit dataset example, features may be name, color, size, etc.
• Some features are special, they are called labels
preencoded.png
What do you mean by a testing
data set?
• The training data set is a collection of examples given to the model to analyze and learn.
• Just like how a teacher teaches a topic to the class through a lot of examples and illustrations.

• Similarly, a set of labeled data is used to train the AI model.

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

Defined by Developer Follows Instructions Static Learning


Developer specifies patterns and Machine executes predefined rules Cannot modify behavior after initial
relationships in data precisely training

preencoded.png
Learning-Based Approach

Adaptive Supervised Unsupervised Reinforcement


Learning Learning Learning Learning
Machine adapts to data Learning from labeled Discovering patterns in Learning by trial and error,
and rule changes training data unlabeled data rewarded for good actions

Examples: Classification, Regression, Clustering models


preencoded.png
Categories of Machine learning based models
Learning-based approaches are indeed a broad category that encompass both machine
learning and deep learning. Machine learning can further be divided into three parts:

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.

• Supervised Learning indicates having a supervisor as a teacher


• For e.g. A math teacher teaches the class by making the
students learn using a lot of solved examples(training) and
then test the knowledge gained by giving the class, problems
to solve on their own.

Similarly, Supervised Learning is when you make the machine


learn by teaching or training the machine using labeled data.

preencoded.png
Supervised Learning Example

Predicting coin type from weight

1 Dataset: Coin 2 Training 3 Prediction


Weights Model learns to associate weights Model can now identify coin type
1 Euro = 5g, 1 Dirham = 7g, 1 Dollar = with coin types from new weight
3g, 1 Rupee = 4g
preencoded.png
Unsupervised Learning
WHAT IS UNSUPERVISED What are the Key Features:
LEARNING
• Learns without supervision
• It works with unlabeled data (no predefined answers).
• Finds patterns, clusters, or groupings in data
• The machine learns on its own by finding hidden patterns and
• Useful when we don’t know much about the data
relationships in the data.
• Example- a child learning to swim alone in a pool – trying and
• No human guidance is needed during training.The machine
discovering techniques without being taught.
learns on its own

By finding hidden patterns and relationships in the data.

Example
A supermarket collects customer shopping history.

• There's no label saying who buys groceries.


• The model analyzes this data and groups regular grocery buyers together.
• These groups (called clusters) help target offers.
preencoded.png
Test Yourself:
Identify the model: Supervised or Unsupervised?
Case 1: Social Media platforms identify your friend in a picture from
an album of tagged photographs

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

[Note that suspicious transactions are not defined in this case]

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

· Deals with labelled data. · Deals with unlabelled data.

· Useful in real-world problems- like · Useful in finding unknown patterns within


predicting the prices of an item something data-like making sense of a large number of
based on past trends. observations from an experimental device.

· Computing power required is simpler as · The computing power required is more


clean labelled data is used as input. complex as unsorted and messy data is used
as input.
preencoded.png
Reinforcement Learning
This learning approach enables the computer to make a series of decisions that maximize a reward metric for
the task without human intervention and without being explicitly programmed to achieve the task.

Reinforcement Learning – Example


• Reinforcement learning is a type of learning in which a machine learns to perform a task through a repeated trial-and-error method.
• Let's say you provide an image of an apple to the machine and ask the machine to predict it-
• The machine first predicts it as 'cherry' and you give negative feedback that it'sincorrect.
• Now, the machine learnsthat it's not a cherry.

• Then again, you ask the machine to predict the fruit


by giving an image of an apple as input;
• Now, it knows it is not a cherry.
• It predicts it as an apple and you give positive
feedback that it's correct.
• So, now the machine learns that this is an apple.

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.

Examples of Reinforcement Learning

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.

• Regression algorithms predict a continuous value based on the input variables.


• Continuous values as Temperature, Price, Income, Age, etc.

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.

Example 2: Predicting the price of the house


Predicting the price of the house based on some parameters:

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).

Example 3: Used Car Price Prediction


This model predicts the selling price of the car with the help of a few parameters like
- fuel type, - years of service, - the number of previous owners, - kilometers driven, - transmission type (manual/automatic)

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

the training dataset.


Test Yourself:
Identify the model: Classification or Regression?

Case 1: Predicting whether a customer is eligible for a bank loan or not?

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)

Case 2: Predicting weather for next 24 hours

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.

Example: Music Clustering


Jim prefers songs with slow tempo and soft intensity.

• The model forms two clusters:


• Cluster 1: Songs Jim likes
• Cluster 2: Songs he doesn’t
• If a new song matches Cluster 1, the model predicts Jim will like it.

Clustering helps identify hidden patterns in data.


It powers features like recommendations on Spotify or Netflix.
preencoded.png
Association
Association Rule is an unsupervised learning method that is used to find
interesting relationships between variables from the database.

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.

• Can automatically extract features • Takes in an input image and assigns


from data without programmer input. importance (weights and biases) to
different parts.
• Each node in the network acts as a
mini machine learning algorithm. • Can identify and distinguish between
different objects in the image.
• Especially useful for very large
datasets like images or audio. • Widely used in image recognition,
object detection, and computer
vision tasks.

preencoded.png
2.3 Artificial Neural Networks
Purpose: To understand and experience what a neural network is like.

About the Topic:

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.

How Neural Networks Work


• Divided into layers:
• Input Layer: Takes in data (no processing).
• Hidden Layers: Perform computations using weights and biases.
• Output Layer: Delivers the final result (no processing).
• Nodes in hidden layers act as mini algorithms and pass results to the next layer.
• The system learns by trial and error, adjusting weights to improve accuracy. preencoded.png
Real-World Applications of Neural Networks
Neural networks are super useful in real life. Here’s where you’ll see them:
• Facial Recognition: Unlocking phones or tagging people in photos
• Chatbots: Like the support chat on shopping websites
• Price Prediction: Estimating vegetable prices or stock values

preencoded.png
preencoded.png
preencoded.png
preencoded.png
Mind Map :
Quick Review of the Chapter!

preencoded.png

You might also like