Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
98 views

Assignment 1

NPTEL Assignment Solution 1

Uploaded by

Vijay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

Assignment 1

NPTEL Assignment Solution 1

Uploaded by

Vijay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment 1

Introduction to Machine Learning


Prof. B. Ravindran
1. Which of the following are supervised learning problems? (multiple may be correct)

(a) Learning to drive using a reward signal.


(b) Predicting disease from blood sample.
(c) Grouping students in the same class based on similar features.
(d) Face recognition to unlock your phone.

Sol. (b), (d)


(a) is a reinforcement learning problem. (c) is unsupervised learning problem.
2. Which of the following are classification problems? (multiple may be correct)
(a) Predict the runs a cricketer will score in a particular match.
(b) Predict which team will win a tournament.
(c) Predict whether it will rain today.
(d) Predict your mood tomorrow.
Sol. (b), (c), (d)
All these have categorical labels.
3. Which of the following is a regression task? (multiple options may be correct)
(a) Predict the price of a house 10 years after it is constructed.
(b) Predict if a house will be standing 50 years after it is constructed.
(c) Predict the weight of food wasted in a restaurant during next month.
(d) Predict the sales of a new Apple product.
Sol. (a), (c), (d)
(b) is classification.
4. Which of the following is an unsupervised learning task? (multiple options may be correct)

(a) Group audio files based on language of the speakers.


(b) Group applicants to a university based on their nationality.
(c) Predict a student’s performance in the final exams.
(d) Predict the trajectory of a meteorite.

Sol. (a), (b)


Grouping objects or people is unsupervised learning task.

1
5. Given below is your dataset. You are using KNN regression with K=3. What is the prediction
for a new input value (3, 2)?
X1 X2 Y
2 5 3.5
5 5 5
3 3 3
6 3 4.5
2 2 2
4 1 2.5
Use Euclidean distance measure for finding closest points.

(a) 2
(b) 3
(c) 3.5
(d) 2.5
Sol. (d)
Plot looks like this:

Closest points = (2,2), (3,3), (4,1)


Average over Y = 2+3+2.5
3 = 2.5
6. Which of the following is a reinforcement learning task? (multiple options may be correct)
(a) Learning to drive a cycle
(b) Learning to predict stock prices
(c) Learning to play chess
(d) Leaning to predict spam labels for e-mails
Sol. (a), (c)
These involve learning from trial and error.

2
7. Find the mean of squared error for the given predictions:
Y f(x)
1 2
2 3
4 5
8 9
16 15
32 31
Hint: Find the squared error for each prediction and take the mean of that.

(a) 1
(b) 2
(c) 1.5
(d) 0

Sol. (a)

(Y − f (x))2
P
M ean squared error =
6
(−1)2 + (−1)2 + (−1)2 + (−1)2 + 12 + 12
=
6
6
=
6
=1

8. Find the mean of 0-1 loss for the given predictions:


Y f(x)
Cat Cat
Cat Dog
Dog Panda
Panda Panda
Rat Dog
Rat Rat

(a) 1
(b) 0
(c) 1.5
(d) 0.5
Sol. (d)

3
L(Y, f (x))
M ean 0 − 1 error =
6
0+1+1+0+1+0
=
6
3
=
6
= 0.5

Where L is given by the following matrix:


 
0 1 1 1
1 0 1 1
 
1 1 0 1
1 1 1 0

9. Bias and variance are given by:

(a) E[fˆ(x)] − f (x), E (E[fˆ(x)] − fˆ(x))2


 
2
(b) E[fˆ(x)] − f (x), E (E[fˆ(x)] − fˆ(x))


(c) (E[fˆ(x)] − f (x))2 , E (E[fˆ(x)] − fˆ(x))2


 
2
(d) (E[fˆ(x)] − f (x))2 , E (E[fˆ(x)] − fˆ(x))


Sol. (a)
Refer to lecture.
10. Which of the following are true about bias and variance? (multiple options may be correct)
(a) Complex models tend to have high bias.
(b) Complex models tend to have low bias.
(c) Complex models tend to have low variance.
(d) Complex models tend to have high variance.
Sol. (b), (d)
Refer to lecture.

You might also like