Unit-2: Advanced Concepts of Modeling in AI
1. Differentiate between AI,ML and DL with a neatly labelled diagram.
Ans:
2. Briefly explain how a machine learning model works.
Ans: 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.
This is just a broad representation of how a
machine learning model works. Input (past or
historical data) is given to the ML model and
the model generates output by learning from
the input data.
Example,ML model learns from the input data
to classify between apples and strawberries and predicts the correct output .
3. Explain any two examples of machine learning models.
Object Classification: Identifies and labels objects present with in an image or data point. It
determines the category an object belongs to.
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
4. Briefly explain how a Deep learning model works.
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 algorithms for themselves. Deep
Learning is the most advanced form of Artificial Intelligence out of these three. Following is the block
diagram of deep learning:
Input is given to an ANN, and after processing,
the output is generated by the DL block.
Example if 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).
5. Explain examples of Deep learning models.
Object Identification
Object classification in deep learning tackles the task of identifying and labelling 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.
6. Define i) Data. ii) Data Labels?
Data is information in any form
For e.g. A table with information about fruits is data
Data Labelling is the process of attaching meaning to data. It depends on the context of the problem
we are trying to solve For e.g. if we are trying to predict what fruit it is based on the colour of the
fruit, then colour is the feature, and fruit name is the label.
7. What is the difference between labelled Data and Unlabelled Data?
labelled Data: Data to which some tag/label is attached. For e.g. Name, type, number, etc.
Unlabelled Data: The raw form of data. Data to which no tag is attached
8. Differentiate between training data set and testing data set.
The training data set is a collection of examples given to the model to analyse and learn.
Just like how a teacher teaches a topic to the class through a lot of examples and illustrations.
Similarly, a set of labelled data is used to train the AI model.
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 labelled data and then verify results with labels.
9. What is Modelling in AI ?
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.
10. Write a short note on Rule Based Approach.
Rule Based Approach refers to the AI modelling where the relationship or patterns in data are defined
by the developer. The machine follows the rules or instructions mentioned by the developer, and
performs its task accordingly.
Rule-based Chatbots are commonly used on websites to answer frequently asked questions (FAQs)
or provide basic customer support.
11. ‘A clothing website has a Chabot to answer questions about order tracking’. Explain how it will work
with rule based AI approach.
Ans:
Scenario: A clothing website has a Chabot to answer questions about order tracking.
1. Data: The Chabot doesn't require a massive dataset for training. It relies on a predefined set of
questions and corresponding answers.
2. Rules: The Chabot uses a decision tree approach with clearly defined rules to understand user
queries and provide responses. Here's a simplified example:
Rule 1: If the user's message contains keywords like "track order," "shipment status," or "delivery,"
proceed to order tracking options.
Rule 2: Under order tracking options:
▪ If the user asks for their order number, prompt them to enter it.
▪ If the user enters a valid order number, retrieve the tracking information from the database and
display it.
▪ If the user enters an invalid order number, provide an error message
and ask them to re-enter it.
Rule 3: If the user's message doesn't match any defined rules, offer a message like "Sorry, I can't help
you with that. Perhaps you can try searching our FAQs or contact customer support."
3. Interaction: When a user chats with the bot, their message is analyzed based on the defined rules.
The Chabot responds with a pre-written answer or prompts the user for additional information
depending on the scenario
12. What are the drawbacks of Rule Based Approach?
A drawback/feature for this approach is that the learning is static.
The machine once trained, does not take into consideration any changes made in the original training
dataset.
That is, if you try testing the machine on a dataset which is different from the rules and data you fed
it at the training stage, the machine will fail and will not learn from its mistake.
Once trained, the model cannot improvise itself on the basis of feedbacks
13. Write a short note on learning based approach.
A learning-based approach is a method where a computer learns how to do something by looking at
examples or getting feedback, similar to how we learn from experience. Instead of being explicitly
programmed for a task, the computer learns to perform it by analyzing data and finding patterns or
rules on its own.
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 might also come up with some very unusual clustering algorithm which you might not have even
thought of!
14. Write some advantages of learning based approach.
Learning based approach 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.
That is, if the model is trained with X type of data and the machine designs the algorithm around it,
the model would modify itself according to the changes which occur in the data so that all the
exceptions are handled in this case.
15. How spam email filter work in AI?
A learning-based spam email filter is a computer program that automatically identifies whether an
incoming email is spam or not. Instead of being explicitly programmed with rules for identifying
spam, the filter learns from examples of labeled emails during a training phase.
During training, the filter is provided with a large dataset of emails, each labeled as either spam or
legitimate (non-spam). The filter analyzes the content and characteristics of these emails, such as
words used, sender information, and presence of attachments.
Using machine learning algorithms, the filter learns to recognize patterns that distinguish spam
from legitimate emails.
Once trained, the filter can classify new incoming emails as spam or not spam based on the patterns
it learned.
It continuously adapts and improves its accuracy over time as it encounters new examples.
This learning-based approach allows the filter to effectively identify and filter out spam emails,
helping users manage their email inbox more efficiently.
16. What are the different 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:
17. Differentiate between classification and regression models in machine learning?
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.
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.
18. Name and explain some 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 the training dataset.
19. 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)
20. Differentiate 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.
21. What is association and how it uses in E-commerce?
Association Rule is an unsupervised learning method that is used to find interesting relationships
between variables from the database.
Based on the purchase pattern of customers A and B, 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.
22. Define ANN and CNN.
Artificial Neural networks (ANN) - Artificial Neural networks are modelled on the human brain and
nervous system. They are able to automatically extract features without input from the programmer.
Every neural network node is essentially a machine learning algorithm. It is useful when solving
problems for which the data set is very large.
Convolutional Neural Network (CNN) - Convolutional Neural Network is a Deep Learning algorithm
which can take in an input image, assign importance (learnable weights and biases) to various
aspects/objects in the image and be able to differentiate one from the other
23. What are the features of ANN?
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 dataset is very large, such as in images.
24. Name some real life application of ANN.
Real-world applications of neural network are facial recognition, customer support
chatbot,vegetable price prediction etc.
25. Convert the following scenarios to perceptron:
Context: A manager is deciding whether to approve a work-from-home request from an employee.
Factors:
Does the employee perform well when working remotely?
Are there any upcoming team meetings or collaborative projects? (Will the employee need
to work closely with others soon?
Does the company's policy support remote work?
Is it beneficial for both the employee and the company?
(Assume that all the inputs are 1 other than team meetings)
Ans:
Let's assume we have 4 inputs(features): x1,x2, x3 and x4,
weights w1,w2, w3 and w4
bias b.
In these context these are the inputs
Does the employee perform well when working remotely? X1(yes)
Are there any upcoming team meetings or collaborative
projects? X2(no)
Does the company's policy support remote work? X3(yes)
Is it beneficial for both the employee and the company? X4(yes)
The values for the weights can come from experience.
Each input has a weight that represents its importance in the decision.
w₁ = 0.6 (performance is very important)
w₂ = -0.5 (meetings/collaboration conflicts with WFH, so negative weight)(that means importance is
less)
w₃ = 0.4 (policy support matters)
w₄ = 0.7 (benefit to both sides is very important)
z = (x₁ × w₁) + (x₂ × w₂) +(x3+w3)+(X4+w4)+ wb
Now Let bias b = -0.2(Bias is always added, but if it's negative, it makes the total smaller → harder to get
approval. If bias is positive, it boosts the total → easier to get approval.
z = (1×0.6) + (0×-0.5) + (1×0.4) + (1×0.7) + (-0.2)
= 0.6 - 0.0 + 0.4 + 0.7 - 0.2
z = 1.0
Activation Function
It applies a function (often the step function) to z:
output = 1, if z >= 0
output= 0 if z<0
Here z is greater than 0 so output is 1
Manager will approve work from home request
26. Context: A homeowner is deciding whether to invest in solar panels for their house.
Factors: -
Do I have a sufficient average amount of sunlight in my area?
Are there any available incentives or rebates for installing solar panels?
Does installing solar panels impact the value of my home?
Does solar energy lead to environmental benefits?
(Assume that all the inputs are 1 other than home value.)
Ans:
Factor Input variable
Do I have a sufficient average amount of sunlight X1(yes) (good sunlight)
in my area?
Are there any available incentives or rebates? X2(yes) (rebates available)
Does installing solar panels impact the value of X3(no): No home value increases
my home?
Does solar energy lead to environmental X4(yes) (environmental benefit)
benefits?
Assign Weights (Importance of Each Factor)
X1 Sunlight availability 0.6 (w1)
X2 Government incentives or rebates 0.5 (w2)
X3 Increases property value 0.4 (w3)
X4 Environmental benefit 0.3 (w4)
Bias: b = -0.7 (a bit cautious; default is not to invest unless benefits are strong)
Compute Weighted Sum
z=(x1×w1)+(x2×w2)+(x3×w4)+(x4×w4)+(−0.7)
z=(1×0.6)+(1×0.5)+(0×0.4)+(1×0.3)+(−0.7)
z=0.6+0.5+0+0.3−0.7
=0.7
Activation Function
If z>=0 → Output = 1 (Invest)
Else → Output = 0 (Don’t Invest)
Since 0.7 > 0 →
Output = 1 → Invest in solar panels
27. Differentiate between Supervised and unsupervised Learning models in AI?