Unit-2
Advance Concepts of Modeling in AI
Differentiate between AI, ML, and DL
Artificial intelligence (AI) is the ability of machines to do cognitive
tasks such as thinking, perceiving, learning, problem-solving, and decision-
making. ML and DL are
subset of Artificial Intelligence.
Artificial Intelligence Machine Learning Deep Learning
DL is a subsite of ML
AI can simulate human ML is a subset of AI, which
that uses artificial neural
intelligence to perform the task. uses algorithms to learn patterns
networks for complex tasks.
from data.
ML depends on labeled data DL requires large
AI has predefined rules.
for making predictions labeled data to perform tasks
DL automates
AL can be rule-based ML can learn automatically
feature extraction and
and require human with less human intervention
lessens human
programming
intervention
AI is used in virtual DL is used in speech
ML is used in spam filtering,
assistants, recommendation recognition, autonomous
image recognition, etc.
systems, etc. vehicles, etc.
Artificial Intelligence
Artificial intelligence (AI) is the simulation of human intelligence in robots that
have been trained to think and act like humans. The term can also refer to
any machine that
demonstrates, like humans, the ability to learn and solve the problem is
Artificial Intelligence.
Machine Learning (ML)
Machine learning is a part of an Artificial Intelligence application in which we
give data to the machine and allow them to learn for themselves. It’s
essentially getting a machine to accomplish something without being
specifically programmed to do so. The machine learns from its mistakes and
takes them into consideration in the next execution. It improvises itself using
its own experiences.
Here is an example which shows labelled images (every image is tagged
either as apple or strawberry) are given as input to the ML model. ML model
learns from the input data to
classify between apples and strawberries and predicts the correct output as shown.
Examples of Machine Learning (ML)
Object Classification – Object classification refers to the process of
identifying and categorizing specific objects within an image or video.
For example, there is an image with multiple animals; if you want to
categorize or identify a specific animal, then it is only possible with
machine learning.
Anomaly Detection – Anomaly detection helps us find the unexpected
things hiding in our data. For example, tracking your heart rate, and
finding a sudden spike could be an anomaly, flagging a potential issue.
Deep Learning (DL)
Deep learning is a part of Artificial Intelligence that uses neural networks with
multi-layer. Deep learning analyzes the data, learns the data and solves the
problem the same as a human. Deep learning requires the machine to be
educated with a large quantity of data in order to train itself. Deep Learning is
the most advanced form of Artificial Intelligence out of these three.
Here is an example which shows pixels of a bird image given as input to the
DL Model and the model is able to analyze and correctly predict that it is a
bird using a deep learning algorithm (ANN).
Examples of Deep Learning (DL)
Object Identification – Object classification in deep learning
tackles the task of identifying and labeling objects within an image.
It essentially uses powerful algorithms to figure out what’s in a
picture and categorize those things.
Digit Recognition – Digit recognition in deep learning tackles the
challenge of training computers to identify handwritten digits (0-9)
within images.
Common terminologies used with data
Common terminologies used with
data What is 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 do you mean by Features?
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
What are Labels?
Data Labeling is the process of attaching meaning to data. For e.g. if we are
trying to predict what fruit it is based on the color of the fruit, then color is the
feature, and fruit name is the label. Data can be of two types – Labeled and
Unlabeled
What are Labeled Data?
Data to which some tag/label is attached is known as labeled data. For
example, name, type, number, etc. Unlabeled data is a raw form of data that
has no tag attached.
What do you mean by a training 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.
What do you mean by a testing data set?
The testing data set is used to test the accuracy of the model. Just like how a
teacher takes a class test related to a topic to evaluate the understanding
level of students. Test is performed without labeled data and then verify
results with labels.
Modeling
AI Modelling refers to developing algorithms, also called models which can be
trained to get intelligent outputs. An AI model is a program that uses
algorithms to analyze data and make decisions without human intervention.
AI models are trained on data sets to
recognize patterns and perform tasks.
There are two different approaches in AI models
Generally, AI models can be classified as follows:
Rule Based Approach
Learning Based Approach
Rule Based – Rule Based AI modelling where the rules are defined by the
developer. The machine follows the rules or instructions mentioned by the
developer and performs its task accordingly. For example, Rule-based
Chatbots are commonly used on websites to answer frequently asked
questions (FAQs) or provide basic customer support.
A drawback of the rule-based approach
In a rule-based approach, the learning is static.
Once trained, the machine will not make any changes in the training dataset.
Once the model is trained, the model cannot improvise itself on
the basis of feedback.
In a rule-based model, it does what it has been taught once.
Learning Based – Refers to the AI modelling where the machine learns by
itself. Under the Learning Based approach, the AI model gets trained on the
data fed to it and then is able to design a model which is adaptive to the
change in data. Random data is provided to the computer in this method, and
the system is left to figure out patterns and trends from it.
The learning-based approach can further be divided into three parts:
For example, suppose you have a dataset of 1000 images of random stray
dogs of your area. Now you do not have any clue as to what trend is being
followed in this dataset as you don’t know their breed, or colour or any other
feature. Thus, you would put this into a learning approach-based AI machine
and the machine would come up with various patterns it has observed in the
features of these 1000 images. It might cluster the data on
the basis of colour, size, fur style, etc. It mightt also come up with some very
unusual clustering algorithm which you might not have even thought of!
The learning-based approach can further be divided into three parts:
1. Supervised Learning
Supervised learning is a machine learning technique that uses labeled data to
train algorithms to predict outcomes. 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.
Supervised Learning – Example
Let’s consider the example of currency coins. Problem Statement: Build a
model to predict the coin based on its weight. Assume that we have different
currency coins (dataset) having different weights. 1 Euro weighs 5 grams, 1
Dirham weighs 7 grams, 1 Dollar weighs 3 grams, 1 Rupee weighs 4 grams
and so on.
Feature – Weights,
Label – Currency
There are two types of Supervised Learning models:
a. Classification
Where 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.
Examples of the Classification Model
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.
b. 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.
Examples of the Regression Model
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.
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 the training dataset.
2. Unsupervised Learning
An unsupervised learning model works on unlabeled dataset. This means that
the data which is fed to the machine is random and there is a possibility that
the person who is training the model does not have any information regarding
it. It helps the user in understanding what the data is about and what are the
major features identified by the machine in it.
Unsupervised Learning – Example
Assume that we have a customer database with records of their products bought over a
period. Now you being the marketing manager decides to send a grocery offer message
to
those customers who buys grocery regularly. Model could discover patterns
on its own and could come up with two different group a) Grocery Shopper
and Non-grocery Shopper.
Unsupervised learning models can be further divided into two categories:
a. Clustering
Refers to the unsupervised learning algorithm which can cluster the unknown data
according to the patterns or trends identified out of it. The patterns observed
might be the ones which are known to the developer, or it might even come
up with some unique
patterns out of it.
What is the difference between Clustering and Classification?
Classification uses predefined classes in which objects are assigned.
Clustering finds similarities between objects and places them in the
same cluster and it differentiates them from objects in other clusters.
b. Association
Association is another type of unsupervised learning method that uses
different rules to find relationships between variables in a given data set. This
is a data mining technique used for better understanding of customer
purchasing patterns based on relationships between various products.
Association Rule is an unsupervised learning method that is used to
find interesting relationships between variables from the database.
3. 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. It’s based on a trial-and-error
learning process to achieve the goals. Examples of reinforcement learning
are question and answering, machine translation, and text summarization.
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’s incorrect. Now, the machine learns that it’s not a cherry.
Difference between supervised and unsupervised Learning?
Supervised Learning Unsupervised Learning
Deals with labelled data Deals with unlabeled data
Useful in real-world Useful in finding unknown patterns within
problems like predicting the data like making sence of a large number of
prices of an item something observations from an experimental device.
based on past trends.
Computing power
The computing power required is more
required is simpler as clean
complex as unsorted and messy data is used as
labelled data is used as input.
input