Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

GITA AUTONOMOUS COLLEGE, BBSR

(Affiliated to BPUT, Odisha)

Subject-AI&ML Subject Code-MCAT203

Modu B C PO
Part – I le L O &
Short Answer Type Questions PS
O
1 Explain the state-space problem in the context of AI. I 3 2 2
2 Define a production system in AI. I 3 2 2
Differentiate between breadth-first search (BFS) and depth-first search 3 2 2
3 I
(DFS).
What is agent in artificial intelligence? 1 1 1
Ans: In artificial intelligence, an agent refers to any entity, whether it's a
program, robot, or system, that perceives its environment through sensors
4 I
and acts upon that environment through actuators. Essentially, an agent is
anything that can be thought of as perceiving its surroundings and taking
actions to achieve certain goals or objectives.
What is iterative deepening search, and why is it used in AI? 1 1 1
Ans: Iterative deepening search is a search algorithm used in artificial
5 intelligence to explore a search space efficiently while guaranteeing I
completeness. It combines the benefits of both depth-first search (DFS) and
breadth-first search (BFS) algorithms.
Describe the hill climbing algorithm and its application in problem-solving. 3 2 2
Ans: hill climbing algo is a local search algo which continuously moves
in a direction of increasing value to find the best solution to the
problem.

the hill climbing algorithm has several applications in problem-


6 I
solving:

1. Optimization Problems:
2. Machine Learning
3. Routing and Network Optimization
4. Constraint Satisfaction Problems
How does simulated annealing differ from hill climbing in AI search 1 1 1
algorithms?
7 Ans: stimulated annealing is a technique used in ai to find the global I
optimum of a problem, but in hill climbing is a technique used in ai to find
the local maximum to a problem.
8 What is A* search, and what makes it a heuristic search algorithm? I 1 1 1
9 What is uninformed search? Explain with an example. I 1 1 1
10 Briefly explain the MIN-MAX algorithm in the context of adversary search. I 2 1 1
11 What is propositional logic, and what kinds of statements does it deal with? II 1
12 What is compound proposition? Give an example. II 1 2 1
Explain the resolution principle in the context of propositional logic theorem 3 1 1
13 II
proving.
14 Define predicate logic and its significance in AI. II 3 2 2
How are well-formed formulas (wff) converted to CNF in predicate logic? 1 1 1
15 II
Explain the steps.
How does predicate logic extend propositional logic, and what does it allow 1 1 1
16 II
us to express that propositional logic cannot?
17 What are the fundamental concepts of machine learning? III 1 1 1
Differentiate between machine learning terminology and traditional statistics 2 1 1
18 III
terminology.
19 Name two types of machine learning algorithms and briefly describe each. III 2 1 1
Explain the difference between supervised learning and unsupervised 3 2 2
20 III
learning in machine learning.
21 Provide an example of a supervised learning application. III 2 1 1
22 Give an example of an unsupervised learning application. III 2 1 1
23 What role does labeled data play in supervised learning? III 1 1 1
24 How does unsupervised learning deal with unlabeled data? III 1 1 1
Describe one real-world application where machine learning has made a 2 1 1
25 III
significant impact.
26 Explain decision tree induction and its role in supervised learning. IV 3 1 1
27 How are classifiers evaluated in supervised learning? IV 1 1 1
28 Describe the process of rule induction in supervised learning. IV 2 1 1
29 Explain the Naïve Bayesian classification approach. IV 3 2 2
What are support vector machines (SVMs), and what role do they play in 1 1 1
30 IV
supervised learning?
Differentiate between bagging and boosting as ensemble methods in 2 1 1
31 IV
supervised learning.
Provide an example of a real-world application where supervised learning 2 1 1
32 IV
has been successfully applied.
33 What is K-means clustering, and how does it work in unsupervised learning? V 1 2 2
34 Describe the representation of clusters in unsupervised learning. V 2 2 2
35 Explain hierarchical clustering and its significance in clustering tasks. V 3 1 1
Explain the concept of Principal Components Analysis (PCA) and its role in 3 1 1
36 V
dimensionality reduction.
37 What are the different types of reinforcement learning tasks? V 1 1 1
38 Describe an example of each type of reinforcement learning task. V 2 1 1
39 Differentiate between machine learning and deep learning. V 2 1 1
40 Provide an overview of deep learning and mention two of its applications. V 2 1 1
Modu B C PO
Part – II le L O &
Focussed – Short answer type Questions PS
O
1 Using problem solving method solve 8 puzzle problem. I 3 1 1
Explain the concept of a production system in artificial intelligence. 3 1 1
2 Describe its components and how they interact to achieve problem-solving I
tasks.
3 Mention the various problems in hill climbing Algorithm I 3 2 1
4 What is A* heuristic search. Explain I 1 2 1
5 Explain MIN-MAX Adversary search Algorithm with diagram. I 3 2 2
6 State and explain the concepts of reasoning and its types in AI. II 3 2 2
Discuss the process of theorem proving by inference rules using 3 1 1
7 II
propositional logic.
Define predicate logic and explain its advantages over propositional logic in 2 2 1
8 II
AI applications.
9 Convert logical statement into CNF by taking at least 5 logical expressions. II 2 2 2
State and explain the concept of machine learning and how it is efficient to 3 2 2
AI.

Ans. Machine Learning (ML):

 Definition: Machine learning refers to the process of teaching


computers to learn from data without being explicitly programmed to
do so.
 How It Works:
o ML algorithms analyze data, find patterns, and make predictions
or decisions based on those patterns.
o Instead of following fixed rules, ML models adapt and improve
over time.
 Types of ML:
o Supervised Learning: Trained on labeled data (input-output
10 pairs). III
o Unsupervised Learning: Works with unlabeled data to find
patterns or groupings.
o Reinforcement Learning: Agents learn through feedback
(rewards or penalties).

Efficiency in AI:

 Automation: ML enables automation by learning from data and


performing tasks that were previously manual.
 Complex Tasks: ML models handle complex tasks, freeing humans to
focus on creative and strategic aspects.
 Innovation: ML opens up new possibilities for innovation by
automating routine processes and decision-making.

11 Mention various classifications and application of machine learning. III 2 1 1


12 Explain classification algorithm with an example. III 3 1 1

Ans. Classification Algorithm:

 Definition: Classification is a type of supervised machine learning where


the goal is to predict the category or class of a given input based on
training data.
 How It Works:
o The algorithm learns from labeled data (input features with
corresponding output labels).
o It builds a model that can classify new, unseen data into
predefined classes.

Example: Email Spam Detection


 Problem: Classify emails as either “spam” or “not spam”.
 Data:
o Labeled dataset with emails (features) and corresponding labels
(spam or not spam).
 Algorithm:
o Let’s use the Naive Bayes classification algorithm.
 Process:

o Training:
 The algorithm learns from historical email data.
 Calculates probabilities of words occurring in spam and
non-spam emails.
o Prediction:
 Given a new email, calculate the probability that it
belongs to each class.
 Choose the class with the highest probability.

 Output:
o When a new email arrives, the model predicts whether it’s spam
or not.

13 What are the different statistical measures used in machine learning. III 1 1 1
How to evaluate classification model? Explain 3 1 1
Ans. There are two main steps in classification
🞂 Step1: Model Construction (learning step, or training step)
⭢ Construct a classification model based on training data
⭢ Training data
🢝 A set of tuples
🢝 Each tuple is assumed to belong to a predefined class
🢝 Labeled data (ground truth)
⭢ How a classification model looks like?
14 A classification model can be represented by one of the following forms: IV
🢝 Classification rules
🢝 Decision trees
🢝 Mathematical formulae
Step2: Model Usage
Before using the model, we first need to test its accuracy
⭢ Measuring model accuracy
🢝 To measure the accuracy of a model we need test data
🢝 Test data is similar in its structure to training data (labeled data)

15 Explain support vector machine algorithm. IV 3 1 1


Ans. Support Vector Machine Algorithm

Support Vector Machine or SVM is one of the most popular


Supervised Learning algorithms, which is used for Classification
as well as Regression problems. However, primarily, it is used for
Classification problems in Machine Learning.
The goal of the SVM algorithm is to create the best line or
decision boundary that can segregate n-dimensional space into
classes so that we can easily put the new data point in the correct
category in the future. This best decision boundary is called a
hyperplane.

SVM chooses the extreme points/vectors that help in creating the


hyperplane. These extreme cases are called as support vectors,
and hence algorithm is termed as Support Vector Machine.

SVM algorithm can be used for Face detection, image


classification, text categorization, etc.

Types of SVM

SVM can be of two types:

o Linear SVM: Linear SVM is used for linearly separable


data, which means if a dataset can be classified into two
classes by using a single straight line, then such data is
termed as linearly separable data, and classifier is used
called as Linear SVM classifier.
o Non-linear SVM: Non-Linear SVM is used for non-linearly
separated data, which means if a dataset cannot be
classified by using a straight line, then such data is termed
as non-linear data and classifier used is called as Non-
linear SVM classifier.

What is linear SVM and non-linear SVM? 1 2 2


o Ans.Linear SVM: Linear SVM is used for linearly separable
data, which means if a dataset can be classified into two
classes by using a single straight line, then such data is
termed as linearly separable data, and classifier is used
16 IV
called as Linear SVM classifier.

Non-linear SVM: Non-Linear SVM is used for non-linearly


separated data, which means if a dataset cannot be classified by
using a straight line, then such data is termed as non-linear data
and classifier used is called as Non-linear SVM classifier
17 Write the difference between bagging and boosting. IV 1 1 1
Ans. Differences Between Bagging and Boosting
S.N Bagging Boosting
O

A way of combining
The simplest way of combining predictions that
predictions that belong to the different
1. belong to the same type. types.
Aim to decrease variance, not Aim to decrease bias,
2. bias. not variance.
Models are weighted
Each model receives equal according to their
3. weight. performance.
New models are
influenced
by the performance of
Each model is built previously built
4. independently. models.
Different training data subsets
are selected using row sampling Every new subset
with replacement and random contains the elements
sampling methods from the that were misclassified
5. entire training dataset. by previous models.
Bagging tries to solve the over- Boosting tries to
6. fitting problem. reduce bias.
If the classifier is
stable and simple (high
If the classifier is unstable (high bias) the apply
7. variance), then apply bagging. boosting.
In this base classifiers
In this base classifiers are are trained
8. trained parallelly. sequentially.
Example: The
Example: The Random forest AdaBoost uses
9 model uses Bagging. Boosting techniques
18 Explain reinforcement algorithm. V 3 1 1
Ans. Reinforcement Learning (RL) is a type of machine learning
algorithm that learns to solve a multi-level problem by trial and error. Here’s a
simple explanation:
1. What It Does:
o RL helps an agent make decisions by interacting with an
environment.
o The agent receives either rewards or penalties for the actions it
performs.
o Its goal is to maximize the total reward.
2. Examples:
o Game Playing: An RL agent learns to win games (like chess or
video games) by trying different moves.
o Robotics: Robots learn tasks (like picking objects) through
practice.
o Self-Driving Cars: RL models learn driving policies.

19 Write down the importance of unsupervised learning. V 1 2 2


Ans.
the importance of unsupervised learning in machine learning:
1. Discover Hidden Patterns:
o Unsupervised learning helps reveal hidden structures and
patterns within data.
o It identifies relationships that may not be apparent through
manual observation.
o For example, clustering algorithms group similar data points,
allowing us to understand data organization.
2. Data Exploration and Preprocessing:
o Unsupervised learning is useful for exploratory data analysis.
o It helps researchers and analysts understand data distributions,
outliers, and anomalies.
o By identifying data clusters or groups, it aids in data
preprocessing.
3. Feature Engineering:
o Unsupervised learning assists in feature
extraction and dimensionality reduction.
o Techniques like Principal Component Analysis (PCA) reduce
feature space while preserving information.
o Extracted features can improve model performance in
subsequent supervised tasks.
4. Customer Segmentation:
o Businesses use unsupervised learning to segment
customers based on behavior, preferences, or demographics.
o Segmentation helps tailor marketing strategies, personalize
recommendations, and optimize product offerings.
5. Anomaly Detection:
o Unsupervised learning identifies unusual patterns or outliers in
data.
o It is crucial for fraud detection, network security, and quality
control.
o For instance, detecting fraudulent credit card transactions.
6. Recommendation Systems:
o Collaborative filtering and matrix factorization are unsupervised
techniques used in recommendation systems.
o They suggest relevant products, movies, or content to users
based on their behavior.
7. Reducing Labeling Costs:
o Unsupervised learning doesn’t require labeled data.
o It’s cost-effective because labeling large datasets can be time-
consuming and expensive.
8. Pretraining for Deep Learning:
o Unsupervised learning can pretrain neural networks.
o Pretrained models learn useful features from unlabeled data,
which can be fine-tuned for specific tasks.
Mention unsupervised learning and explain various type of unsupervised 2 2 3
learning.
Ans. Unsupervised learning is a machine learning technique where models
learn from unlabeled data without explicit supervision. Unlike supervised
learning, which relies on labeled input-output pairs, unsupervised learning
focuses on finding patterns, structures, and relationships within the data.
the types of unsupervised learning:
1. Clustering:
o Clustering groups similar data points together based on their
features.
o Examples:
 K-means Clustering: Divides data into K clusters.
 Hierarchical Clustering: Creates a tree-like structure of
clusters.
2. Association Rules:
o Association rule mining identifies interesting relationships
20 between variables.
V
o It discovers patterns like “if X, then Y.”
o Examples:
 Market Basket Analysis: Finding associations between
purchased items.
 Apriori Algorithm: Detecting frequent itemsets.
3. Dimensionality Reduction:
o Dimensionality reduction reduces the number of features
while preserving information.
o It helps visualize high-dimensional data and removes noise.
o Examples:
 Principal Component Analysis (PCA): Finds orthogonal
axes that capture most variance.
 t-SNE (t-Distributed Stochastic Neighbor
Embedding): Visualizes data in lower dimensions.

Modu B C PO
Part – III le L O &
Long answer type Questions PS
O
1 Explain Hill Climbing Algorithm. I 3 3 2

Ans.
2 Define problem space. Solve water-jug problem using production rules by I 3 2 1
taking 1 ltr of water in 3 ltr of jug.
Ans.
Explain AO* heuristic search. 3 2 2

3 I

Ans.

4 Explain Steepest-Ascent hill-climbing and how it is differ from simple hill I 3 3 1


climbing algorithm..
Ans. Steepest-Ascent Hill-Climbing is an improvement over the basic hill-
climbing algorithm. Both algorithms belong to the family of local search
algorithms used in optimization problems. They iteratively explore
neighboring solutions in search of the optimal solution. However, they differ
in their strategy for selecting the next solution to explore.
Steepest-ascent hill-climbing algorithm explores all neighboring solutions
and selects the one with the best evaluation, ensuring that it always moves
in the direction of the steepest ascent.

Key Differences:

1. Exploration Strategy:
 Simple hill climbing: It only considers one neighboring
solution at a time and moves to the first neighbor with a
better evaluation.
 Steepest-ascent hill climbing: It evaluates all
neighboring solutions and selects the one with the best
evaluation (steepest ascent).
2. Efficiency:
 Simple hill climbing: It may get stuck in local optima or
plateaus since it doesn't explore all neighboring
solutions.
 Steepest-ascent hill climbing: It is more likely to find the
global optimum since it systematically explores all
possible neighboring solutions.
3. Computational Cost:
 Simple hill climbing: It has lower computational cost
since it only evaluates one neighboring solution at each
iteration.
 Steepest-ascent hill climbing: It has a higher
computational cost since it evaluates all neighboring
solutions to select the best one.

5 Explain Alpha-Beta Cut-off Adversary search Algorithm with diagram. I 3 3 2


Ans.
The humidity is high or the shy is cloudy. 2 2 2
If the sky is cloudy, then it will rain.
6 If the humidity is high then it is hot. II
It is not hot.
Prove It will rain. By using inference rules.
(PQ)Q 1 2 2
(PP)R
7 II
(PS)~(SQ)
Prove R
8 Explain the fundamentals of propositional logic and its role in artificial II 3 1 1
intelligence.
1. Ans. Propositions: These are statements that can be either
true or false. Propositions are represented by variables (p, q, r,
etc.) and can be simple or compound.
2. Logical Operators: These are symbols used to form
compound propositions from simple propositions. The main
logical operators in propositional logic are:
 Negation (¬): Represents the logical "not" operation. It
takes a proposition and produces its negation.
 Conjunction (∧): Represents the logical "and"
operation. It takes two propositions and produces true if
both propositions are true, otherwise false.
 Disjunction (∨): Represents the logical "or" operation. It
takes two propositions and produces true if at least one
of the propositions is true, otherwise false.
 Implication (→): Represents the logical "if...then"
operation. It expresses that if the first proposition is
true, then the second proposition must also be true. It
can also be written as "if p, then q".
 Biconditional (↔): Represents the logical "if and only if"
operation. It expresses that two propositions are
logically equivalent, meaning they have the same truth
value. It can also be written as "p if and only if q".
3. Truth Values: Each proposition in propositional logic can have
one of two truth values: true (T) or false (F).

Propositional logic plays a significant role in artificial intelligence (AI)


for various reasons:

1. Representation of Knowledge: AI systems often need to


represent knowledge about the world in a structured form.
Propositional logic provides a way to represent this knowledge
using simple statements and logical relationships.
2. Inference and Reasoning: AI systems use propositional logic
for inference and reasoning. Given a set of propositions and
logical rules, AI systems can derive new conclusions or make
decisions based on the existing knowledge.
3. Planning and Problem Solving: In domains such as planning
and problem-solving, propositional logic can be used to
represent goals, actions, and constraints. This allows AI systems
to search for solutions by manipulating logical expressions.
4. Semantic Networks and Expert Systems: Semantic networks,
which represent knowledge as nodes and edges, can be
translated into propositional logic. Expert systems, which
mimic human expertise in a specific domain, often use
propositional logic to represent rules and make decisions.

9 Enumerate types of Machine Learning algorithms. Explain each with III 3 2 2


example.
Ans.

10 Differentiate between Machine Learning and Statistics with five key points. III 2 3 2

Machine Learning Statistics


Machine Learning is a lot of steps
Statistics is a numerical idea in
or rules taken care of by the user
finding the pattern from the
where the machine comprehends
information.
and train without anyone else.

It makes the most accurate It interfaces the relationship


prediction possible and then foresee between the variables and finds
future events or arrange a current out the connection between the
material. information points.

Inputs and Outputs are labels and Inputs and Outputs are Data
features. points.

It consists of Mathematics and It consists of only Mathematical


Algorithms. and Statistical Information.

It is mainly used to find a


It is mainly used in the hypothesis correlation between the data
or prediction. points, univariate, multivariable,
etc.

It concerned in the field of Data It concerned in the field of Data


Science and Artificial Intelligence Analytics and Artificial
with concepts like predominant Intelligence with concepts like
algorithms and neural networks. probabilities and derivatives.

Keywords: Decision Tree, Neural


Keywords: Covariance,
Networks, Logistic Regression,
Univariate, Estimators, etc.
Support Vector Machine, etc.

Types: Regression,
Types: Supervised, Unsupervised,
Classification, and Forecasting
and Reinforcement Learning.
Continuous Variable.

Applications: Statistics
Applications: Weather forecasting, description techniques, finding
Stock Market Prediction, etc. patterns in the data, outliers in the
data, etc.

11 Explain five key terminologies used in Machine Learning. III 3 2 2


five key terminologies commonly used in Machine Learning (ML):
1. Relationships:
o In ML, relationships refer to how inputs (features) relate to the
output (label or prediction).
o For example, in linear regression, the relationship between input
features and the predicted output can be expressed as y = b +
wx, where y is the label, w represents the weight (slope),
and x denotes the features (input values).
2. Labels:
o Labels are the target values we want to predict.
o In supervised learning, labels are known for the training data
(e.g., class labels in classification tasks or numeric values in
regression).
o For instance, predicting whether an email is spam or not (binary
classification) involves labels.
3. Features:
o Features are the input variables used to make predictions.
o They represent different aspects of the data.
o Examples of features include pixel values in an image,
temperature, age, or any measurable attribute.
4. Models:
o A model defines the relationship between features and labels.
o It captures patterns in the data.
o Models can be linear (like linear regression), non-linear (like
neural networks), or specialized (like decision trees).
5. Training and Inference:
o Training:
 During training, the model learns from labeled data.
 It adjusts its parameters (weights) to minimize prediction
errors.
 The goal is to create a model that can answer questions
(e.g., predict house prices).
o Inference:
 Inference occurs when the trained model is used to
make predictions on new, unseen data.
 It’s like putting the model into production.
 For example, using a trained image classifier to identify
objects in real-time images.

12 Discuss the differences between Supervised Learning and Unsupervised III 2 1 1


Learning.
Ans.

Supervised Learning Unsupervised

Uses Known and Labeled Data


Uses Unknown Data as input
Input Data as input

Less Computational
More Computational Complex
Computational Complexity Complexity

Uses Real-Time Analysis of


Uses off-line analysis
Real-Time

The number of Classes is The number of Classes is not


Number of Classes known
Accurate and Reliable Results
Accuracy of Results

The desired, output is not


The desired output is given.
Output data

In supervised learning it is not In unsupervised learning it is


possible to learn larger and possible to learn larger and
more complex models than in more complex models than in
Model unsupervised learning

In supervised learning training In unsupervised learning


Training data data is used to infer model training data is not used.

Supervised learning is also Unsupervised learning is also


Another name called classification.

Test of model We can test our model. We can not test our model.

Example Optical Character Recognition

Describe the process of building a decision tree classifier by taking a suitable 2 2 2


example.
Principle
⭢ Basic algorithm (adopted by ID3, C4.5 and CART): a greedy
algorithm
⭢ Tree is constructed in a top-down recursive divide-and-conquer
manner
Iterations
⭢ At start, all the training tuples are at the root
13 IV
⭢ Tuples are partitioned recursively based on selected attributes
⭢ Test attributes are selected on the basis of a heuristic or statistical
measure (e.g., information gain)
Stopping conditions
⭢ All samples for a given node belong to the same class
⭢ There are no remaining attributes for further partitioning –
majority voting is employed for classifying the leaf
⭢ There are no samples left

14 Discuss the process of Rule Induction in classification. IV 2 1 1


Ans. . Rule induction is a fundamental technique used to create rule-based
models from raw data. These rules represent hidden patterns and knowledge
contained within the training data. Here are the key steps involved in rule
induction for classification:
1. Rule-Based Classification:
o Rule-based classifiers use a set of IF-THEN rules for
classification.
o Each rule expresses a condition (antecedent) and a predicted
class (consequent).
o For example, consider the rule:
o IF age = youth AND student = yes THEN
buy_computer = yes
 Here, age and student are attributes,
and buy_computer is the predicted class.
2. Extracting Rules from Decision Trees:
o Decision trees are commonly used for classification.
o Rule induction involves extracting rules from a decision tree.
o For each path from the root to a leaf node in the tree, we create
a rule.
o The splitting criteria along the path form the rule’s antecedent,
and the leaf node holds the class prediction (consequent).
3. Sequential Covering Algorithm:
o This algorithm extracts IF-THEN rules directly from the training
data without first building a decision tree.
o It learns rules one at a time for each class.
o The process involves:
 Creating a rule that covers many tuples of a specific
class.
 Removing the covered tuples from the dataset.
 Repeating the process for the remaining tuples.
o Examples of sequential covering algorithms include AQ, CN2,
and RIPPER.
4. Rule Pruning:
o Rule pruning is essential to avoid overfitting.
o Pruning removes unnecessary conjuncts (conditions) from rules.
o Reasons for pruning:
 Quality assessment is based on the original training
data, but rules may perform differently on new data.
 Pruning ensures that rules generalize well.
o Methods like FOIL (First Order Inductive Learner) are used for
effective rule pruning.

15 Explain Naïve Bayes’ classification model. IV 3 1 1

Ans. Naïve Bayes Classifier Algorithm

o Naïve Bayes algorithm is a supervised learning algorithm,


which is based on Bayes theorem and used for solving
classification problems.
o It is mainly used in text classification that includes a high-
dimensional training dataset.
o Naïve Bayes Classifier is one of the simple and most
effective Classification algorithms which helps in building
the fast machine learning models that can make quick
predictions.
o It is a probabilistic classifier, which means it predicts
on the basis of the probability of an object.
o Some popular examples of Naïve Bayes Algorithm
are spam filtration, Sentimental analysis, and classifying
articles.

Bayes' Theorem:
o Bayes' theorem is also known as Bayes' Rule or Bayes'
law, which is used to determine the probability of a
hypothesis with prior knowledge. It depends on the
conditional probability.
o The formula for Bayes' theorem is given as:

Where,

P(A|B) is Posterior probability: Probability of hypothesis A on


the observed event B.

P(B|A) is Likelihood probability: Probability of the evidence


given that the probability of a hypothesis is true.

Advantages of Naïve Bayes Classifier:

o Naïve Bayes is one of the fast and easy ML algorithms to


predict a class of datasets.
o It can be used for Binary as well as Multi-class
Classifications.
o It performs well in Multi-class predictions as compared to
the other Algorithms.
o It is the most popular choice for text classification
problems.

Disadvantages of Naïve Bayes Classifier:

o Naive Bayes assumes that all features are independent or


unrelated, so it cannot learn the relationship between
features.

Applications of Naïve Bayes Classifier:

o It is used for Credit Scoring.


o It is used in medical data classification.
o It can be used in real-time predictions because Naïve
Bayes Classifier is an eager learner.
o It is used in Text classification such as Spam
filtering and Sentiment analysis.

16 Discuss the principles of Support Vector Machines (SVM). IV 2 1 1

Ans. Support Vector Machine Algorithm

Support Vector Machine or SVM is one of the most popular


Supervised Learning algorithms, which is used for Classification
as well as Regression problems. However, primarily, it is used for
Classification problems in Machine Learning.

The goal of the SVM algorithm is to create the best line or


decision boundary that can segregate n-dimensional space into
classes so that we can easily put the new data point in the correct
category in the future. This best decision boundary is called a
hyperplane.

SVM chooses the extreme points/vectors that help in creating the


hyperplane. These extreme cases are called as support vectors,
and hence algorithm is termed as Support Vector Machine.
Consider the below diagram in which there are two different
categories that are classified using a decision boundary or
hyperplane:

SVM algorithm can be used for Face detection, image


classification, text categorization, etc.

Types of SVM

SVM can be of two types:

o Linear SVM: Linear SVM is used for linearly separable


data, which means if a dataset can be classified into two
classes by using a single straight line, then such data is
termed as linearly separable data, and classifier is used
called as Linear SVM classifier.
o Non-linear SVM: Non-Linear SVM is used for non-linearly
separated data, which means if a dataset cannot be
classified by using a straight line, then such data is termed
as non-linear data and classifier used is called as Non-
linear SVM classifier.

17 Explain K-means clustering algorithm with an example where k=2. V 3 1 1

Ans. K-Means Clustering Algorithm:


1. Objective:
o K-means aims to partition a dataset into K predefined distinct
clusters.
o Each cluster represents a collection of data points exhibiting
certain similarities.
2. Steps:
o Step 1 (Initialization):
 Choose the number of clusters K.
 Randomly select K data points as initial cluster centers
(centroids).
o Step 2 (Assignment):
 Calculate the distance between each data point and
each cluster center (using Euclidean distance or other
distance functions).
 Assign each data point to the cluster whose center
is nearest.
o Step 3 (Update):
 Re-compute the center of each newly formed cluster by
taking the mean of all data points in that cluster.
o Repeat Steps 2 and 3 until one of the stopping criteria is met:
 Center of newly formed clusters does not change
significantly.
 Data points remain in the same cluster.
 Maximum number of iterations is reached.
3. Advantages:
o Relatively efficient with time complexity (O(nkt)).
o Often terminates at a local optimum (global optimum can be
found using techniques like Simulated Annealing or Genetic
Algorithms).
4. Disadvantages:
o Requires specifying the number of clusters in advance (K).
o Cannot handle noisy data and outliers.
o Unsuitable for identifying clusters with non-convex shapes.

Example with K=2:


Consider eight data points (locations represented by (x, y)):

 A1 (2, 10)
 A2 (2, 5)
 A3 (8, 4)
 A4 (5, 8)
 A5 (7, 5)
 A6 (6, 4)
 A7 (1, 2)
 A8 (4, 9)

Initial cluster centers:

 A1 (2, 10)
 A4 (5, 8)

After the second iteration:

 New center for Cluster 1: (2, 7)


 New center for Cluster 2: (4, 8)

The final centers represent the two clusters.

18 Explain the difference between agglomerative and divisive hierarchical V 3 2 2


clustering. Construct dendrogram for each.
Ans;

Agglomerative Divisive
S.No. Parameters Clustering Clustering

Top-down
1. Category Bottom-up approach
approach

each data point starts all data points start


in its own cluster, and in a single cluster,
the algorithm and the algorithm
recursively merges recursively splits
2. Approach the closest pairs of the cluster into
clusters until a single smaller sub-
cluster containing all clusters until each
the data points is data point is in its
obtained. own cluster.

3. Complexity Agglomerative Comparatively less


level clustering is expensive as
generally more
computationally
expensive, especially divisive clustering
for large datasets as only requires the
this approach calculation of
requires the distances between
calculation of all sub-clusters, which
pairwise distances can reduce the
between data points, computational
which can be burden.
computationally
expensive.

Agglomerative
divisive clustering
clustering can handle
may create sub-
outliers better than
clusters around
4. Outliers divisive clustering
outliers, leading to
since outliers can be
suboptimal
absorbed into larger
clustering results.
clusters

Agglomerative divisive clustering


clustering tends to can be more
produce more difficult to interpret
interpretable results since the
since the dendrogram dendrogram shows
shows the merging the splitting
5. Interpretability
process of the process of the
clusters, and the user clusters, and the
can choose the user must choose a
number of clusters stopping criterion
based on the desired to determine the
level of granularity. number of clusters.

Scikit-learn provides
multiple linkage
methods for
divisive clustering
agglomerative
6. Implementation is not currently
clustering, such as
implemented in
“ward,” “complete,”
Scikit-learn.
“average,” and
“single,”

7. Example Here are some of the Here are some of


applications in which the applications in
Agglomerative which Divisive
Clustering is used : Clustering is used :
Image segmentation, Market
Customer segmentation,
segmentation, Social Anomaly detection,
Biological
network analysis,
classification,
Document clustering,
Natural language
Genetics, genomics,
processing, etc.
etc., and many more.
1
6
_____|_____
_____|_____
| |
| |
| |
| |
2 3
4 5
___|___
___|___ _|_
_|_
| | | | |
| | | | |
| | | | |
| | | | |
1 2 3 7 8
4 5 6 7 8

19 Define PCA and explain how it differs from K-means clustering. V 2 2 2


Ans. Principal Component Analysis (PCA) and K-means clustering are both
fundamental techniques used in unsupervised learning

PCA (Principal Component Analysis):

 PCA is a dimensionality reduction technique used to transform


high-dimensional data into a lower-dimensional space while
preserving as much variance as possible.
 PCA identifies the principal components (PCs), which are
orthogonal directions in the feature space that capture the
most variability in the data.
 The principal components are computed such that the first PC
explains the maximum amount of variance in the data, the
second PC explains the maximum remaining variance
orthogonal to the first PC, and so on.
 PCA does not require any class labels or clustering information.
It operates solely based on the covariance structure of the
data.
 PCA can be used for data visualization, noise reduction, feature
extraction, and speeding up subsequent learning algorithms by
reducing the dimensionality of the input data.
 Differences between PCA and K-means clustering:
 PCA is primarily used for dimensionality reduction and feature
extraction, while K-means clustering is used for data
partitioning and clustering.
PCA produces a reduced-dimensional representation of the
data, while K-means clustering assigns each data point to one
of K clusters.
 PCA utilizes the covariance structure of the data to capture its
variability, while K-means clustering operates based on the
distance between data points in the original feature space.
 PCA does not require specifying the number of clusters or
initializations, while K-means clustering requires setting the
number of clusters K and may be sensitive to initializations.
 PCA is often used as a preprocessing step before other
machine learning algorithms, while K-means clustering is used
for tasks such as customer segmentation, image compression,
and anomaly detection.

20 What are the key characteristics of a reinforcement learning task? Provide V 1 3 2


examples of three different types of tasks that can be addressed with
reinforcement learning techniques.
Ans.
Certainly! Let’s explore the key characteristics of reinforcement learning
(RL) and provide examples of different types of tasks that can be addressed
using RL techniques:

Key Characteristics of Reinforcement Learning:


1. No Supervision, Only Rewards:
o In RL, there is no supervisor providing explicit labels or answers.
o The agent learns solely from reward signals received after
taking actions.
o It aims to maximize cumulative rewards over time.
2. Sequential Decision Making:
o RL tasks involve making a sequence of decisions over time.
o Actions impact future states and rewards.
o Examples include game moves, robot control, and financial
trading.
3. Delayed Feedback:
o Feedback in RL is not prompt; it is delayed.
o The consequences of an action may only be observed later.
o The agent must learn to associate actions with delayed rewards.
4. Exploration vs. Exploitation:
o RL agents balance exploration (trying new actions)
and exploitation (choosing known good actions).
o Exploration helps discover better strategies, while exploitation
maximizes immediate rewards.
5. Agent-Environment Interaction:
o The RL agent interacts with an environment.
o It takes actions, receives feedback, and updates its policy.
o The environment dynamics determine the next state and reward.

Examples of RL Tasks:
1. Game Playing:
o Chess: An RL agent learns to play chess by exploring different
moves and maximizing its chances of winning.
o Atari Games: RL algorithms have achieved superhuman
performance in games like Pong, Breakout, and Space Invaders.
2. Robotics and Autonomous Vehicles:
o Robotic Arm Control: RL agents learn to manipulate robotic
arms to perform tasks like picking objects.
o Self-Driving Cars: RL models learn driving policies by
interacting with simulated or real-world environments.
3. Resource Optimization:
o Energy Management: RL optimizes energy consumption in
smart grids or buildings.
o Inventory Management: RL agents decide when to restock
items to minimize costs.

You might also like