PM SHRI KV BILASPUR
ARTIFICIAL INTELLIGENCE NOTES
Unit 2. Advanced Concepts of Modelling in AI
SYLLABUS
Learning Objectives:
1. To familiarize students with supervised, unsupervised and reinforcement learning based approach
2. To Introduce students to the neural network.
Learning Outcomes:
1. Understand supervised, unsupervised and reinforcement learning based
approach
2. . 2. Understand Neural Networks
2.1 Revisiting AI, ML and DL
Differentiate between AI, ML, and DL
Artificial Intelligence, or AI for short, refers to any technique that enables computers to mimic human
intelligence. An artificially intelligent machine works on algorithms and data fed to it and gives the desired
output.
Machine Learning, or ML for short, enables machines to improve at tasks with experience. The machine
here learns from the new data fed to it while testing and uses it for the next iteration. It also takes into
account the times when it went wrong and considers the exceptions too.
Deep Learning, or DL for short, enables software to train itself to perform tasks with vast amounts of data.
Since the system has got huge set of data, it is able to train itself with the help of multiple machine learning
algorithms working altogether to perform a specific task.
Ankita Kshatriya CLASS X AI NOTES
Artificial Intelligence is the umbrella term which holds both Deep Learning as well as Machine Learning.
Deep Learning, on the other hand, is the very specific learning approach which is a subset of Machine
Learning as it comprises of multiple Machine Learning algorithms.
Venn Diagram
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.
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.
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.
Ankita Kshatriya CLASS X AI NOTES
Examples of Machine Learning (ML)
Deep Learning (DL)
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
It is the most advanced form of Artificial Intelligence out of these three.
Following is the block diagram of deep learning:
Ankita Kshatriya CLASS X AI NOTES
Common terminologies used with data
Ankita Kshatriya CLASS X AI NOTES
2.2 Modelling
Rule-Based Approach
Ankita Kshatriya CLASS X AI NOTES
• In this approach, the developer defines the relationship or patterns in data using fixed rules.
• The machine follows these rules exactly to perform the task.
• It does not learn from new data. Once trained, it cannot adapt or improve with experience.
🔹 Example:
Rule-based chatbots are commonly used on websites to answer FAQs or provide basic customer support.
Suppose a clothing website has a chatbot:
1. If the user types “track order” → the bot asks for the order number.
2. If the order number is valid → it fetches and shows tracking details.
3. If the order number is invalid → it shows an error message and asks to re-enter.
4. If the question does not match any rule → it replies “Sorry, I can’t help you with that.’’
Rule-based models work only on predefined rules given by humans. They are simple but cannot learn or
adapt.
Learning-Based Approach
• In this approach, the machine learns patterns from data instead of being given fixed rules.
• The machine is trained with data and it designs its own algorithm to map inputs to outputs.
• It can adapt when new data is given and improve over time.
Example :
A spam email filter works on the learning-based approach.
• The system is trained with a large dataset of emails labelled as spam or not spam.
• It studies the features (like keywords, sender, attachments, etc.) that differentiate spam from
genuine emails.
• Once trained, the filter can automatically detect and classify new emails as spam or not spam.
• Unlike rule-based systems, it keeps improving as more examples are added.
Conclusion :
Rule-Based Approach → Machine follows fixed rules written by humans. (Example: Chatbot on a
shopping site)
Ankita Kshatriya CLASS X AI NOTES
Learning-Based Approach → Machine learns patterns from data and improves with experience.
(Example: Spam email filter)
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:
1. Supervised Learning
• Definition: Machine learns using labelled data (input + correct output).
• Process: The system is trained with examples, then tested on new data.
• Example :
Predicting a coin based on its weight.
o Dataset: Euro = 5g, Dirham = 7g, Dollar = 3g, Rupee = 4g.
o Feature: Weight
o Label: Currency
The machine learns from labelled examples and then correctly identifies a coin when a new
weight is given.
2. Unsupervised Learning
• Definition: Machine learns using unlabelled data (only input, no output given).
Ankita Kshatriya CLASS X AI NOTES
• Process: The system finds patterns, clusters, or groups in data on its own.
• Example :
A supermarket customer database.
o No labels (like “grocery shopper” or “non-grocery shopper”).
o The model analyses purchase history and forms clusters (e.g., frequent grocery buyers vs.
others).
o Used in recommendation systems (like Netflix or Spotify).
3. Reinforcement Learning
• Definition: Machine learns by trial and error, receiving rewards or penalties for its actions.
• Process: System takes actions in an environment → gets feedback (positive or negative) → improves
decision-making.
• Example :
Identifying an apple from an image:
o First, the model wrongly predicts it as “cherry” → gets negative feedback.
o Next time, it learns and predicts “apple” → gets positive feedback.
o Over time, it learns the correct behaviour.
Other examples: Parking a car or humanoid walking.
Summarising..
Type of Learning Data Used How It Learns Example from Book
Supervised Labelled data (input + Learns from teacher-like Predicting a coin from weight,
Learning output) examples Email spam filter
Unsupervised Unlabelled data (only Finds hidden Supermarket customer database,
Learning input) patterns/clusters OTT recommendations
Reinforcement No labels, just Learns by trial-and-error Apple identification by trial,
Learning environment feedback with rewards Parking a car
Ankita Kshatriya CLASS X AI NOTES
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.
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.
Sub-categories of Supervised Learning Model
Ankita Kshatriya CLASS X AI NOTES
1. Classification Model
• Definition:
A model that classifies data into categories (labels).
It works on discrete data (separate groups).
• How it works:
o Trained with labelled data (input + category).
o Learns patterns and applies them to new data.
• Examples :
o Weather Prediction (Hot/Cold):
Model is trained on past weather data labelled as Hot or Cold. When given tomorrow’s data,
it predicts whether the weather will be Hot or Cold.
o Spam Detection in Emails:
The model is trained with thousands of emails labelled as Spam or Not Spam. For a new
email, it predicts the correct category.
• Key Point: Output is always in the form of categories (Yes/No, Hot/Cold, Spam/Not Spam).
2. Regression Model
• Definition:
A model that predicts continuous values (numbers).
It works on continuous data (not fixed categories).
• How it works:
o Trained with labelled continuous data.
o Predicts numeric values for new input.
• Examples :
o Predicting Temperature:
Based on previous weather data, the model predicts tomorrow’s temperature (like 32.5°C).
o House Price Prediction:
Features: Bedrooms, Carpet size, Garage area
Label: Price
Model predicts house prices for new properties.
o Used Car Price Prediction:
Features: Fuel type, Years of service, Number of owners, Kilometers driven, Transmission
Ankita Kshatriya CLASS X AI NOTES
type
Output: Predicted selling price (continuous number).
• Key Point: Output is always a number/continuous value (e.g., salary, temperature, price).
Graphical Representation :
Sub-categories of Unsupervised Learning Model
1. CLUSTERING MODEL
Ankita Kshatriya CLASS X AI NOTES
In this example, we have input data with no class labels (unlabelled 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.
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.
a. ASSOCIATION MODEL
EXAMPLE (ASSOCIATION MODEL):
Ankita Kshatriya CLASS X AI NOTES
SUMMARY:
Classification Model Regression Model
Works on discrete data Works on continuous data
Predicts categories Predicts numeric values
Example: Spam vs Not Spam emails Example: Predicting house prices
1. Clustering
Ankita Kshatriya CLASS X AI NOTES
• Definition:
Clustering is grouping data into clusters (groups) based on similarities.
The data has no labels — the model finds patterns on its own.
• How it works:
o The machine analyzes features of the data.
o Groups similar items together into clusters.
• Examples :
o Animals & Birds: Even without labels, the model groups animals in one cluster and birds in
another, based on similarities.
o Music Recommendation: A person likes slow, soft songs. The model clusters such songs into
one group and recommends similar songs.
o OTT Platforms (Netflix/Spotify): Groups movies or songs based on user preferences.
2. Association
• Definition:
Association finds relationships between variables/items in a dataset.
It is used to discover rules like “If X happens, Y also happens.”
• How it works:
o Looks at purchase or usage patterns.
o Generates association rules (e.g., If a customer buys A, they will also likely buy B).
• Examples :
o Market Basket Analysis:
If customers buy bread, they are also likely to buy butter.
o Recommendation Systems:
Online shopping sites suggest “Frequently bought together” items.
Clustering Association
Groups data into clusters based on similarity Finds relationships between items/variables
No predefined labels, model discovers patterns itself Discovers “if–then” rules from data
Example: Grouping animals vs. birds, grouping similar songs Example: If customer buys bread → also buys butter
Focus is on grouping Focus is on co-occurrence/association
Ankita Kshatriya CLASS X AI NOTES
Clustering Association
Sub-categories of Deep Learning Model
Artificial Neural networks(ANN) - Artificial Neural networks are modelled on the human brain and nervous
system. They can 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.
2.3 Artificial Neural Networks
What is Neural Network?
Neural networks are loosely modelled after how neurons in the human brain behave.
The key advantage of neural networks is that they can 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.
Diagram:
Working of Neural Network :
Ankita Kshatriya CLASS X AI NOTES
✓ A Neural Network is divided into multiple layers and each layer is further divided into several blocks
called nodes. Each node has its own task to accomplish which is then passed to the next layer.
✓ Neural Network consists of an input layer, hidden layer which performs computation using weights
and biases on each node and finally, information is passed through these layers to reach the output
layer.
✓ The first layer of a Neural Network is known as the input layer. The job of an input layer is to acquire
data and feed it to the Neural Network. No processing occurs at the input layer.
✓ Next to it, are the hidden layers. Hidden layers are the layers in which the whole processing occurs.
Their name essentially means that these layers are hidden and are not visible to the user. Each node
of these hidden layers has its own machine learning algorithm which it executes on the data
received from the input layer.
✓ The hidden layer performs computation by means of weights and biases Information passes from
one layer to the other after the value found from this calculation passed through a selected
activation function.
✓ The process of finding the right output begins with trial and error until the network finally learns.
✓ With each try, the weights are adjusted based on the error found between the desired output and
the network output.
Real-world applications of neural network are facial recognition, customer support chatbot, vegetable
price prediction etc.
How does AI make a Decision?
• AI makes decisions using a model called a Perceptron (basic unit of a neural network).
• Just like humans consider different factors before making a choice, AI also considers multiple inputs
with different importance (called weights).
• These inputs are combined with weights and bias, and the total is compared with a threshold.
• If the total crosses the threshold → AI gives one decision.
• If not → AI gives another decision.
Example :
Suppose you are deciding whether to go to the park.
• Inputs (factors):
1. Do I have a jacket?
2. Do I have an umbrella?
3. Is it sunny now?
4. What is the weather forecast?
Each factor is given a weight depending on its importance.
• AI sums up these inputs × weights + bias.
• If the result is greater than the threshold → decision = Go to the park.
• If result is less → decision = Stay at home.
Ankita Kshatriya CLASS X AI NOTES
Questions:
1. In which type of machine learning is the data labelled with the desired output? a) Supervised Learning b)
Unsupervised Learning c) Reinforcement Learning d) Deep Learning
2. An email spam filter that learns to identify spam emails based on labelled examples is an application of:
a) Supervised Learning b) Unsupervised Learning c) Reinforcement Learning d) Transfer Learning
3. A machine learning algorithm that groups similar customer purchases into clusters for recommendation
systems uses: a) Supervised Learning b) Unsupervised Learning c) Reinforcement Learning d) Neural
Networks
4. An AI agent playing a game and learning from its rewards and penalties is an example of: a) Supervised
Learning b) Unsupervised Learning c) Reinforcement Learning d) Evolutionary Learning
5. Which of the following statements is NOT true about supervised learning? a) Requires labelled data for
training. b) Used for classification and regression tasks. c) Can be less efficient for large datasets. d) Often
used in image recognition applications.
6. In an unsupervised learning scenario, the goal is to: a) Predict a specific output based on labelled data.
b) Identify patterns and relationships within unlabelled data. c) Train an AI agent through rewards and
penalties. d) Develop complex neural network architectures.
7. Clustering algorithms are commonly used in unsupervised learning for: a) Spam filtering b) Image
classification c) Stock price prediction d) Grouping similar data points
8. Reinforcement learning is particularly useful forscenarios where: a) Large amounts of labelled data are
available. b) The desired outcome is clear, but the path to achieve it is unknown. c) The data is structured
and easily categorized. d) The task requires reasoning and logical deduction.
9. Imagine an AI playing a game and learning to win by trial and error. This is an example of: a) Supervised
Learning b) Unsupervised Learning c) Reinforcement Learning d) Natural Language Processing
10. Artificial neural networks are inspired by the structure and function of: a) The human brain b) Quantum
computers c) Complex mathematical models d) High-speed processors
11. The process of adjusting the weightsin a neural network to improve performance is called: a) Activation
b) Learning c) Optimization d) Training
12. A neural network with multiple layers of interconnected neurons is called a: a) Single-layer network b)
Deep Neural Network c) Linear network d) Perceptron
13. Neural networks are particularly well-suited for tasks involving: a) Simple calculations and mathematical
operations b) Recognizing patterns in complex data like images and text c) Performing logical deductions
and reasoning tasks d) Storing and retrieving large amounts of information
14. Training a neural network often requires: a) A small set of labelled data samples b) A significant amount
of data and computational resources c) A specific set of programming instructions d) A human expert to
guide the learning process
Assertion and reasoning-based questions:
Ankita Kshatriya CLASS X AI NOTES
Q1. Assertion: Unsupervised Learning is a type of learning without any guidance. Reasoning: Unsupervised
learning models work on unlabelled datasets, where the data fed into the machine is random and the
person training the model may not have any prior information about it
Options: (a) Both A and R are true and R is the correct explanation for A (b) Both A and R are true and R is
not the correct explanation for A (c) A is True but R is False (d) A is false but R is True
Q2. Assertion (A): Information processing in a neural network relies on weights and biases assigned to
nodes. Reasoning (R): These weights and biases determine how strongly a node is influenced by its inputs
and its overall contribution to the next layer.
Options: (a) Both A and R are true and R is the correct explanation for A (b) Both A and R are true and R is
not the correct explanation for A (c) A is True but R is False (d) A is false but R is True
Answer the following questions:
Q1. Give difference between rule based and learning based AI models.
Q2. What is supervised, unsupervised and reinforcement learning? Explain with examples. Q3. What is
clustering and how is it different from classification?
Q4. Explain neural networks. Also give functions of three layers of neural networks.
Q5. Differentiate between classification and regression model.
Q6. What is neural network? Give the functioning of its three layers?
Q7. Identify the type of learning (supervised, unsupervised, reinforcement learning) are the following case
studies most likely based on?
a) Case Study 1: A company wants to predict customer churn based on past purchasing behavior,
demographics, and customer interactions. They have a dataset with labelled examples of customers who
churned and those who did not.
b) Case Study 2: A social media platform wants to group users based on their interests and behavior to
recommend relevant content. They have a large dataset of user interactions but no predefined categories.
Which type of learning is this case study most likely based on?
c) Case Study 3: An autonomous vehicle is learning to navigate through a city environment. It receives
feedback in the form of rewards for reaching its destination safely and penalties for traffic violations. Which
type of learning is this case study most likely based on?
d) Case Study 4: A healthcare provider wants to identify patterns in patient data to personalize treatment
plans. They have a dataset with various patient attributes but no predefined labels indicating specific
treatment plans. Which type of learning is this case study most likely based on?
e) Case Study 5: A manufacturing company wants to optimize its production process by detecting
anomalies in sensor data from machinery. They have a dataset with examples of normal and anomalous
behavior. Which type of learning is this case study most likely based on?
Q8. Identify the type of model (classification, regression, clustering, association model) are the following
case studies most likely based on?
a) A bank wants to predict whether a loan applicant will "default" or "non-default" on their loan payments.
They have a dataset containing information such as income, credit score, loan amount, and employment
status.
Ankita Kshatriya CLASS X AI NOTES
b) A real estate agency wants to predict the selling price of houses based on various features such as size,
location, number of bedrooms, and bathrooms. They have a dataset containing historical sales data.
c) A marketing company wants to segment its customer base into distinct groups based on purchasing
behavior for targeted marketing campaigns. They have a dataset containing information such as purchase
history, frequency of purchases, and amount spent.
d) A grocery store wants to identify associations between different products purchased by customers to
understand which products are commonly bought together. They have a transaction dataset containing
records of items purchased together during each transaction.
Q9. A healthcare provider wants to improve patient care by predicting the length of hospital stays for
different medical conditions. They have a dataset containing patient demographics, medical history, and
treatment details. The task involves:
a) To predict whether a patient will have a short or long hospital stay.
b) To predict the number of days a patient will stay in the hospital.
c) To segment patients into groups with similar characteristics for personalized treatment plans.
d) To identify patterns in patient treatments and outcomes
Identify the type of model (classification, regression, clustering, and association model) in the above tasks.
Ankita Kshatriya CLASS X AI NOTES