ML Assignment 3 Nptel 2019
ML Assignment 3 Nptel 2019
Introduction to
Machine Learning
Assignment- Week 3
TYPE OF QUESTION: MCQ
Number of questions: 8 Total mark: 8 X 2 = 16
QUESTION 1:
Suppose, you have given the following data where x and y are the 2 input variables and Class is
the dependent variable.
X Y Class
-1 1 -
0 1 +
0 2 -
1 -1 -
1 0 +
1 2 +
2 2 -
2 3 +
Suppose, you want to predict the class of new data point x=1 and y=1 using euclidean distance in
7-NN. To which class the data point belongs to?
A. + Class
B. – Class
C. Can’t say
D. None of these
______________________________________________________________________________
QUESTION 2:
Imagine you are dealing with 15 class classification problem. What is the maximum number of
discriminant vectors that can be produced by LDA?
A. 20
B. 14
C. 21
D. 10
Correct Answer: B. 14
Detailed Solution : LDA produces at most c − 1 discriminant vectors, c = no of classes
______________________________________________________________________________
QUESTION 3:
‘People who bought this, also bought…’ recommendations seen on amazon is a result of which
algorithm?
Detailed Solution : Though both User based and Item based CF methods are used in
recommendation systems, Amazon specifically uses Item based filtering.
______________________________________________________________________________
NPTEL Online Certification Courses Indian
Institute of Technology Kharagpur
QUESTION 4:
A. Only 2
B. 1, 3 and 4
C. 1, 2 and 3
D. 2, 3 and 4
Correct Answer: D
Detailed Solution : PCA is an unsupervised learning algorithm, so 1 is wrong. Other options are
true about PCA.
______________________________________________________________________________
QUESTION 5:
Consider the figures below. Which figure shows the most probable PCA component directions for
the data points?
A. A
B. B
C. C
D. D
Correct Answer: A. A
Detailed Solution : PCA tries to choose the direction in such a way that maximizes the variance in the
data.
______________________________________________________________________________
QUESTION 6:
When there is noise in data, which of the following options would improve the performance of the KNN
algorithm?
Detailed Solution : Increasing the value of k reduces the effect of the noise and improves the
performance of the algorithm.
______________________________________________________________________________
QUESTION 7:
A. KNN algorithm does more computation on test time rather than train time.
B. KNN algorithm does lesser computation on test time rather than train time.
C. KNN algorithm does an equal amount of computation on test time and train time.
D. None of these.
Correct Answer: A. KNN algorithm does more computation on test time rather than train
time.
Detailed Solution : The training phase of the algorithm consists only of storing the feature
vectors and class labels of the training samples.
In the testing phase, a test point is classified by assigning the label which are most frequent
among the k training samples nearest to that query point – hence higher computation.
______________________________________________________________________________
QUESTION 8:
Find the value of the Pearson’s correlation coefficient of X and Y from the data in the following
table.
43 99
21 65
25 79
42 75
A. 0.47
B. 0.68
C. 1
D. 0.33
Correct Answer : B. 0.68
∑(𝑋𝑖−𝑋)((𝑌𝑖−𝑌)
Detailed Solution : Pearson Coefficient 𝑟 = 𝑖
2 2
∑(𝑋𝑖−𝑋) ∑(𝑌𝑖−𝑌)
𝑖 𝑖
______________________________________________________________________________
******END*****
NPTEL Online Certification Courses Indian
Institute of Technology Kharagpur
Introduction to
Machine Learning
Assignment- Week 3
TYPE OF QUESTION: MCQ
Number of questions: 10 Total mark: 10 X 2 = 20
QUESTION 1:
Suppose, you have given the following data where x and y are the 2 input variables and Class is
the dependent variable.
X Y Class
-1 1 -
0 1 +
0 2 -
1 -1 -
1 0 +
1 2 +
2 2 -
2 3 +
Suppose, you want to predict the class of new data point x=1 and y=1 using euclidean distance in
3-NN. To which class the new data point belongs to?
A. + Class
B. – Class
C. Can’t say
D. None of these
Detailed Solution : We have to compute the euclidean distance from the given point (1,1) to all
the data points given in the dataset and based on that we have to check the dominating class for
the 3 nearest points.
NPTEL Online
Certification Courses
Indian Institute of
Technology
Kharagpur
______________________________________________________________________________
QUESTION 2:
Imagine you are dealing with a 10 class classification problem. What is the maximum number of
discriminant vectors that can be produced by LDA?
A. 20
B. 14
C. 9
D. 10
Correct Answer: C. 9
Detailed Solution : LDA produces at most c − 1 discriminant vectors, c = no of classes
______________________________________________________________________________
QUESTION 3:
Detailed Solution: KNN is non-parametric because it does not make any assumption regarding the
underlying data distribution. It is a lazy learning technique because during training time it just
memorizes the data and finally computes the distance during testing.
______________________________________________________________________________
NPTEL Online Certification Courses Indian
Institute of Technology Kharagpur
QUESTION 4:
A. KNN algorithm does more computation on test time rather than train time.
B. KNN algorithm does lesser computation on test time rather than train time.
C. KNN algorithm does an equal amount of computation on test time and train time.
D. None of these.
Correct Answer: A. KNN algorithm does more computation on test time rather than train
time.
Detailed Solution : The training phase of the algorithm consists only of storing the feature
vectors and class labels of the training samples.
In the testing phase, a test point is classified by assigning the label which is the most frequent
among the k training samples nearest to that query point – hence higher computation.
______________________________________________________________________________
QUESTION 5:
Which of the following necessitates feature reduction in machine learning?
A. Irrelevant and redundant features
B. Curse of dimensionality
C. Limited computational resources.
D. All of the above
Correct Answer: D. All of the above
When there is noise in data, which of the following options would improve the performance of the
KNN algorithm?
Detailed Solution : Increasing the value of k reduces the effect of the noise and improves
the performance of the algorithm.
____________________________________________________________________________
QUESTION 7:
Find the value of the Pearson’s correlation coefficient of X and Y from the data in the following
table.
43 99
21 65
25 79
42 75
A. 0.47
B. 0.68
C. 1
D. 0.33
Correct Answer : B. 0.68
∑(𝑋𝑖−𝑋)((𝑌𝑖−𝑌)
Detailed Solution : Pearson Coefficient 𝑟 = 𝑖
2 2
∑(𝑋𝑖−𝑋) ∑(𝑌𝑖−𝑌)
𝑖 𝑖
______________________________________________________________________________
QUESTION 8:
______________________________________________________________________________
QUESTION 9:
In user-based collaborative filtering based recommendation, the items are recommended
based on :
A. Similar users
B. Similar items
C. Both of the above
D. None of the above
Detailed Solution: In User-based CF, items are recommended based on similar users.
______________________________________________________________________________
QUESTION 10:
Identify whether the following statement is true or false?
“PCA can be used for projecting and visualizing data in lower dimensions.”
A. TRUE
B. FALSE
Detailed Solution : Sometimes it is very useful to plot the data in lower dimensions. We
can take the first 2 principal components and then visualize the data.
______________________________________________________________________________
******END*****
Introduction to Machine Learning -IITKGP
Assignment - 3
TYPE OF QUESTION: MCQ/MSQ
Number of questions: 15 Total mark: 2 * 15 = 30
a. Non-parametric, eager
b. Parametric, eager
c. Non-parametric, lazy
d. Parametric, lazy
Correct Answer: c
Explanation: KNN is non-parametric because it does not make any assumption regarding the
underlying data distribution. It is a lazy learning technique because during training time it just
memorizes the data and finally computes the distance during testing.
Q2. You have been given the following 2 statements. Find out which of these options is/are
true in the case of k-NN.
(i) In case of very large value of k, we may include points from other classes into the
neighborhood.
(ii) In case of too small value of k, the algorithm is very sensitive to noise.
Correct Answer: c
a. True
b. False
Correct Answer: a
Explanation: The training phase of the algorithm consists only of storing the feature vectors
and class labels of the training samples.
In the testing phase, a test point is classified by assigning the label which is most frequent
among the k training samples nearest to that query point – hence higher computation.
Q4. Suppose you are given the following images (1 represents the left image, 2 represents
the middle and 3 represents the right). Now your task is to find out the value of k in k-NN in
each of the images shown below. Here k1 is for 1st, k2 is for 2nd and k3 is for 3rd figure.
a. k1 > k2> k3
b. k1 < k2> k3
c. k1 < k2 < k3
d. None of these
Correct Answer: c
Q6. Suppose, you have given the following data where x and y are the 2 input variables and
Class is the dependent variable.
a. + Class
b. – Class
c. Can’t Say
d. None of these
Correct Answer: a
Explanation: All three nearest point are of + class so this point will be classified as + class.
Q7. What is the optimum number of principal components in the below figure?
a. 10
b. 20
c. 30
d. 40
Correct Answer: c
Explanation: We can see in the above figure that the number of components = 30 is giving
highest variance with lowest number of components. Hence option ‘c’ is the right answer.
Q8. Suppose we are using dimensionality reduction as pre-processing technique, i.e, instead
of using all the features, we reduce the data to k dimensions with PCA. And then use these
PCA projections as our features. Which of the following statements is correct?
Correct Answer: b
Explanation: The higher value of ‘k’ would lead to less smoothening of the decision boundary.
This would be able to preserve more characteristics in data, hence less regularization.
Correct Answer: a
a. Cold start
b. Overspecialization
c. None of the above
Correct Answer: a
Explanation: For new users, we have very few transactions. So, it’s very difficult to find similar
users.
Q11. Consider the figures below. Which figure shows the most probable PCA component
directions for the data points?
a. A
b. B
c. C
d. D
Correct Answer: a
Explanation: [Follow the lecture slides]
Choose directions such that a total variance of data will be maximum
1. Maximize Total Variance
Choose directions that are orthogonal
2. Minimize correlation
Q12. Suppose that you wish to reduce the number of dimensions of a given data to dimensions
using PCA. Which of the following statement is correct?
Correct Answer: b
Q13. Suppose you are given 7 plots 1-7 (left to right) and you want to compare Pearson
correlation coefficients between variables of each plot. Which of the following is true?
1. 1<2<3<4
2. 1>2>3>4
3. 7<6<5<4
4. 7>6>5>4
a. 1 and 3
b. 2 and 3
c. 1 and 4
d. 2 and 4
Correct Answer: b
Correct Answer: b
Explanation: LDA produces at most c − 1 discriminant vectors.
Correct Answer: a
Option b is not appropriate for collaborative filtering because it involves predicting the
expected sales volume (number of books sold) as a function of average rating of a book.
Collaborative filtering focuses on user-item interactions and is more concerned with providing
personalized recommendations rather than predicting sales volume based on average ratings.
************END************
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Introduction to
Machine Learning
Assignment- Week 3
TYPE OF QUESTION: MCQ
Number of questions: 10 Total mark: 10 X 2 = 20
QUESTION 1:
Suppose, you have been given the following data where x1 and x2 are the 2 input
variables and Class is the dependent variable.
x1 x2 Class
-1 1 -
0 1 +
0 2 -
1 -1 -
1 0 +
1 2 +
2 2 -
2 3 +
What will be the class of a new data point x1=1 and x2=1 in 5-NN (k nearest neighbour
with k=5) using euclidean distance measure?
A. + Class
B. – Class
C. Cannot be determined
QUESTION 2:
Imagine you are dealing with a 10 class classification problem. What is the maximum
number of discriminant vectors that can be produced by LDA?
A. 20
B. 14
C. 9
D. 10
Correct Answer: C. 9
Detailed Solution : LDA produces at most c − 1 discriminant vectors, c = no of classes
_______________________________________________________________________
QUESTION 3:
_______________________________________________________________________
NPTEL Online Certification Courses Indian
Institute of Technology Kharagpur
QUESTION 4:
A. KNN algorithm does more computation on test time rather than train time.
B. KNN algorithm does lesser computation on test time rather than train time.
C. KNN algorithm does an equal amount of computation on test time and train time.
D. None of these.
Correct Answer: A. KNN algorithm does more computation on test time rather than
train time.
Detailed Solution : The training phase of the algorithm consists only of storing the feature
vectors and class labels of the training samples.
In the testing phase, a test point is classified by assigning the label which is the most
frequent among the k training samples nearest to that query point – hence higher
computation.
_______________________________________________________________________
QUESTION 5:
Which of the following necessitates feature reduction in machine learning?
1. Irrelevant and redundant features
2. Curse of dimensionality
3. Limited computational resources.
A. 1 only
B. 2 only
C. 1 and 2 only
D. 1, 2 and 3
Correct Answer: D. 1,2 and 3
When there is noise in data, which of the following options would improve the performance
of the k-NN algorithm?
Detailed Solution : Increasing the value of k reduces the effect of the noise and
improves the performance of the algorithm.
_______________________________________________________________________
QUESTION 7:
Find the value of the Pearson’s correlation coefficient of X and Y from the data in the
following table.
AGE (X) GLUCOSE (Y)
43 99
21 65
25 79
42 75
A. 0.47
B. 0.68
C. 1
D. 0.33
Correct Answer : B. 0.68
∑(𝑋𝑖−𝑋)((𝑌𝑖−𝑌)
Detailed Solution : Pearson Coefficient 𝑟 = 𝑖
2 2
∑(𝑋𝑖−𝑋) ∑(𝑌𝑖−𝑌)
𝑖 𝑖
Where X = [43,21,25,42], Y = [99,65,79,75], 𝑋 = mean of 𝑋𝑖 values and 𝑌 = mean of
𝑌𝑖 values.
_______________________________________________________________________
QUESTION 8:
A. Only 2
B. 1, 3 and 4
C. 1, 2 and 3
D. 2, 3 and 4
Correct Answer: D
Detailed Solution : PCA is an unsupervised learning algorithm, so 1 is wrong. Other
statements are true about PCA.
_______________________________________________________________________
QUESTION 9:
In user-based collaborative filtering based recommendation, the items are
recommended based on :
A. Similar users
B. Similar items
C. Both of the above
D. None of the above
______________________________________________________________________
QUESTION 10:
Identify whether the following statement is true or false?
“Linear Discriminant Analysis (LDA) is a supervised method”
A. TRUE
B. FALSE
_______________________________________________________________________
******END****