0% found this document useful (0 votes)
13 views22 pages

Answer 2022-23

pyq

Uploaded by

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

Answer 2022-23

pyq

Uploaded by

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

Group-A: Very Short Answer Type Questions

1. Answer any ten of the following:


(i) ______ Is a classification algorithm used to
assign observations to a discrete set of classes.
Answer: Decision Tree (or any appropriate
classification algorithm like Logistic Regression,
Naive Bayes).
(ii) The number of nodes in the input layer is 10
and the hidden layer is 5. The maximum number
of connections from the input layer to the hidden
layer are:
Answer: 10×5=5010 \times 5 = 5010×5=50
(iii) True or False: Hierarchical clustering is slower
than non-hierarchical clustering? Answer: True.
(iv) True or False: Ensemble learning can only be
applied to supervised learning methods. Answer:
False.
(v) A collection of individual models that learn to
predict a target by combining their strengths and
avoiding the weaknesses of each is called:
Answer: Ensemble Model.
(vi) Semi-supervised learning algorithm deals with
which types of data?
Answer: Data that is a combination of labeled and
unlabeled samples.
(vii) In an election, N candidates are competing
against each other, and people are voting for
either of the candidates. Voters don't
communicate with each other while casting their
votes. Which of the following ensemble methods
works similarly to the above-discussed election
procedure?
Answer: Bagging (Bootstrap Aggregating).
(viii) A feature F1 can take certain values: A, B,
C, D, E, and F, and represents the grade of students
from a college. Feature F1 is an example of a
______ variable.
Answer: Categorical Variable.
(ix) Imagine a newborn starts to learn walking. It
will try to find a suitable policy to learn walking
after repeated falling and getting up. Specify what
type of machine learning is best suited?
Answer: Reinforcement Learning.
(x) The selling price of a house depends on many
factors. For example, it depends on the number of
bedrooms, number of kitchens, number of
bathrooms, the year the house was built, and the
square footage of the lot. Given these factors,
predicting the selling price of the house is an
example of which type of linear regression.
Answer: Multiple Linear Regression.
(xi) Targeted marketing, Recommended Systems,
and Customer Segmentation are applications in
which algorithm?
Answer: Clustering Algorithm.
(xii) The ______ is the difference between a
sample statistic used to estimate a population
parameter and the actual but unknown value of
the parameter. Answer: Bias.
Group-B (Short Answer Type Questions)
Answer all of the following (5 marks each):
2. Explain Matrix Factorization and where it is used.
Detailed Answer: Matrix Factorization is a
mathematical technique that decomposes a matrix
into two or more matrices, whose product
approximates the original matrix. It is primarily
used in recommendation systems, especially
collaborative filtering, to discover latent factors
representing user preferences and item attributes.
For example, in movie recommendations, Matrix
Factorization can predict user ratings for unseen
movies by uncovering hidden patterns in user-item
interactions.
3. Why ensemble learning is used? What is the
general principle of an ensemble method, and
what is bagging and boosting in an ensemble
method?
Detailed Answer:
o Purpose of Ensemble Learning: Ensemble
learning improves model performance by
combining predictions from multiple models
to reduce errors.
o General Principle: It leverages the diversity of
individual models to achieve better accuracy
and robustness than any single model.
o Bagging: It trains multiple models on different
random subsets of data and aggregates their
predictions (e.g., Random Forest). Bagging
reduces variance and prevents overfitting.
o Boosting: It trains models sequentially, where
each new model corrects the errors of the
previous ones (e.g., AdaBoost, Gradient
Boosting). Boosting reduces bias and improves
prediction accuracy.

5.K-Means and KNN Algorithm


6. Deciding the Value of "K" in the KNN Algorithm
(Expanded)
How to Choose kkk:
1. Cross-Validation:
o Split the dataset into training and testing
sets.
o Evaluate model accuracy for different kkk
values.
o Choose kkk that minimizes the error rate.
2. Domain Knowledge:
o Use domain-specific insights to decide the
granularity needed for prediction.
3. Data Size:
o Small datasets often require smaller kkk
values, while larger datasets may benefit
from larger kkk.
4. Odd vs. Even kkk:
o Odd kkk avoids ties in classification
problems.
o For regression, odd or even kkk has less
significance as predictions are based on
averages.

Why is Odd kkk Preferable?


1. Avoiding Ties in Classification:
o When kkk is even, there’s a chance of
equal votes for two classes, leading to
ambiguity.
o An odd kkk ensures a clear majority vote.
2. Multi-Class Scenarios:
o With multiple classes, odd kkk avoids the
possibility of equal votes among several
classes.

Impact of kkk on Model Performance:


1. Small kkk (e.g., 1 or 3):
o Advantage: Captures local patterns and
adapts to fine-grained variations.
o Disadvantage: Sensitive to noise and
outliers, leading to overfitting.
2. Large kkk (e.g., 10 or 20):
o Advantage: Reduces noise impact by
considering more neighbors.
o Disadvantage: May oversmooth the
decision boundary, ignoring local
patterns.

Practical Example:
• A fruit classification task:
o Kkk=3: A fruit is classified based on the
labels of its 3 nearest neighbors.
o Kkk=10: A smoother decision boundary is
created, but small clusters may be
ignored.

Group-C (Long Answer Type Questions)


Answer all of the following (15 marks each):
7. (a) Discuss the different types of Machine
Learning.
Expanded Answer: Machine Learning is classified
into three main types:
o Supervised Learning:
▪ Definition: Works with labeled data
(input-output pairs), where the algorithm
learns the mapping from inputs to
outputs.
▪ Applications: Examples include
classification tasks like spam detection
and regression tasks like predicting house
prices.
▪ Key Algorithms: Linear Regression,
Logistic Regression, Decision Trees,
Support Vector Machines.
o Unsupervised Learning:
▪ Definition: Works with unlabeled data to
find patterns or structures within the
dataset.
▪ Applications: Clustering (e.g., customer
segmentation), association rule mining,
and dimensionality reduction (e.g., PCA).
▪ Key Algorithms: K-means, DBSCAN,
Hierarchical Clustering.
o Reinforcement Learning:
▪ Definition: Agents learn by interacting
with an environment, receiving rewards or
penalties, and optimizing their actions.
▪ Applications: Game AI (e.g., AlphaGo),
robotics, and self-driving cars.
▪ Key Algorithms: Q-Learning, Deep
QNetworks, Policy Gradient Methods.
(b) What are parametric and non-parametric models?
Expanded Answer:
o Parametric Models:
▪ Assume a fixed number of parameters,
independent of data size.
▪ Faster to train and easier to interpret.
▪ Examples: Linear Regression, Logistic
Regression, Naive Bayes.
o Non-parametric Models:
▪ Do not assume a fixed parameter count;
they grow with data.
▪ Capture more complex relationships but
may require more data.
▪ Examples: KNN, Decision Trees, Random
Forests.
(c) How is machine learning related to AI?
Expanded Answer: Machine Learning is a subset of AI
focused on enabling systems to learn from data
without explicit programming. It forms the foundation
for AI applications like natural language processing,
image recognition, and recommendation systems. AI
encompasses broader areas such as expert systems and
robotics, while ML provides the tools and techniques to
implement intelligent behavior.
8. (a) Explain Generative Mixture Model. Expanded
Answer: A Generative Mixture Model assumes
that data points are generated from a mixture of
several probability distributions, where each
distribution represents a cluster. For example, the
Gaussian Mixture Model (GMM) uses Gaussian
distributions to model clusters. The goal is to
determine the parameters of these distributions
and the probabilities that a data point belongs to a
particular cluster.
(b) With a proper diagram, explain the steps of a
generative mixture model. Expanded Answer:
o Steps:
1. Initialize the parameters (e.g., means,
variances, and weights for each
distribution).
2. E-step: Compute the posterior
probabilities of cluster membership for
each data point.
3. M-step: Update the parameters of the
distributions using these probabilities.
4. Repeat E and M steps until convergence. o
Diagram: A flowchart can depict data
points being assigned to clusters,
parameters being updated, and
probabilities being recalculated iteratively.
(c) Write down the steps of PCA (Principal
Component Analysis).
Expanded Answer:
o Steps:
1. Standardize the Dataset: Ensure all
features have the same scale.
2. Compute Covariance Matrix: Measure
the relationships between features.
3. Calculate Eigenvalues and Eigenvectors:
Derive principal components.
4. Sort Components: Order eigenvectors by
eigenvalues in descending order.
5. Select Top Components: Retain
components explaining the most variance.
6. Transform Data: Project data onto the
selected components.
o Applications: PCA reduces dimensions in
highdimensional datasets, aiding in
visualization and speeding up algorithms.
9. (a) Explain the Confusion Matrix with respect to
machine learning algorithms with a suitable
example.
Expanded Answer: The Confusion Matrix evaluates
classification performance by comparing actual vs.
predicted outcomes: o Definitions:
▪ True Positive (TP): Correctly predicted

positive cases.
▪ True Negative (TN): Correctly predicted
negative cases.
▪ False Positive (FP): Incorrectly predicted
positives.
▪ False Negative (FN): Incorrectly predicted
negatives.
o Example: In email spam classification:
▪ TP: Emails correctly classified as spam.
▪ TN: Emails correctly classified as not
spam.
▪ FP: Genuine emails wrongly classified as
spam.
▪ FN: Spam emails wrongly classified as
genuine.
o Performance Metrics: Accuracy, precision, recall,
and F1-score are derived from the matrix.
(b) Calculate the accuracy percentage for the given
Confusion Matrix.
Expanded Answer:
o Given Confusion Matrix:
▪ TP = 12, TN = 9, FP = 3, FN = 1.
o Accuracy Formula: Accuracy = (TP + TN) / Total
= (12 + 9) / 25 = 84%.
• 10: Supervised Feature Selection Techniques and
Related Concepts
• (a) Explain three techniques under supervised
feature selection:
• Filter Method:
• Overview: Features are ranked based on their
correlation with the target variable, without
involving a predictive model.
• Example Techniques:
• Chi-square test: Evaluates the dependency
between categorical features and target variables.
• ANOVA (Analysis of Variance): Measures how
different groups (e.g., classes) vary with respect to
numerical features.
• Illustration: A dataset with student performance—
Chi-square can identify if "study hours" are
significantly related to "exam scores."
• Advantages: Computationally inexpensive and
fast.
• Wrapper Method:

Overview: Features are selected based on their


contribution to the model's performance. Subsets
of features are iteratively tested.
• Example Techniques:
• Forward Selection: Starts with no features, adding
one at a time that improves model accuracy.
• Backward Elimination: Starts with all features,
removing the least significant one iteratively.
• Illustration: Recursive Feature Elimination (RFE)
evaluates subsets by training a model multiple
times and ranking features by importance.
• Advantages: Finds feature subsets that optimize
the model but can be computationally expensive.
• Embedded Method:
• Overview: Feature selection is integrated within
the training process of a machine learning model.
• Example Techniques:
• Lasso Regression (L1 regularization): Penalizes less
relevant features, effectively reducing their
coefficients to zero.

• Decision Trees: Rank features by importance


during tree construction.
Illustration: In Lasso Regression for predicting
house prices, irrelevant features like "zipcode"
are automatically excluded.
• Advantages: Combines the speed of filters with
the accuracy of wrappers.

• (b) Benefits of Feature Selection in Machine


Learning:
• Reduces Overfitting:
• Removes irrelevant features, preventing the
model from learning noise.
• Illustration: In text classification, removing rarely
used words reduces irrelevant complexity.
• Improves Interpretability:
• Simplifies models, making them easier to
understand and communicate.
• Illustration: A customer churn model with 5 key
predictors (e.g., "call duration" and "complaints")
is more interpretable than one with 50 features.

• Speeds up Training and Inference:


• Fewer features reduce computational cost and
memory usage.
Illustration: Training a neural network with 10
features is faster than with 1000 features.

• (c) Curse of Dimensionality:


• Definition: As dimensions increase, data points
become sparse, and models struggle to
generalize.
• Impacts:
• Distance Metrics Become Less Informative: In
high-dimensional space, the difference between
the nearest and farthest points diminishes.
• Computational Complexity: High dimensions
exponentially increase the resources needed for
processing.
• Illustration: For a dataset with 100 dimensions,
clustering becomes inefficient as all points appear
equidistant.

• Solutions: Use dimensionality reduction


techniques like PCA or t-SNE.

• Question 11: Artificial Intelligence, Deep Learning,


and Comparisons
(a) What is Artificial Intelligence, and why do we
need it?
• Definition: AI is a field of computer science that
focuses on creating systems capable of tasks that
typically require human intelligence (e.g.,
reasoning, learning, perception).
• Why Needed:
• Automates repetitive tasks, freeing humans for
creative work.
• Solves complex, large-scale problems like
diagnosing diseases and predicting natural
disasters.
• Enhances efficiency and accuracy in industries like
finance, healthcare, and transportation.
• (b) What is Deep Learning, and provide real-world
examples?

• Definition: Deep Learning is a subset of ML that


uses multi-layered neural networks to extract and
learn complex data patterns.
• Examples:
• Self-Driving Cars: Uses object detection models
like CNNs to identify pedestrians, signs, and lanes.
Facial Recognition: Identifies faces in security
systems and smartphones.
• Chatbots: Conversational AI like GPT understands
and generates human-like responses.

You might also like