Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

NPTEL » Introduction To Machine Learning

Week 1: Assignment 1
1). Which of the following is a supervised learning problem?
Grouping related documents from an unannotated corpus.
Predicting credit approval based on historical data.
Predicting if a new image has cat or dog based on the historical data of
other images of cats and dogs, where you are supplied the information
about which image is cat or dog.
Fingerprint recognition of a particular person used in biometric
attendance from the fingerprint data of various other people and that
particular person

Answer: The supervised learning problem among the options you provided is:

Predicting credit approval based on historical data.

In supervised learning, we have a labeled dataset where the input features and
their corresponding outputs are known. In this case, the historical data would
include information about credit applications, such as the applicant's
attributes (e.g., income, age, credit score) and whether their application was
approved or denied. The goal is to build a model that can predict credit
approval for new, unseen applications based on the patterns learned from the
labeled historical data.

2) Which of the following are classification problems?


Predict the runs a cricketer will score in a particular match.
Predict which team will win a tournament.
Predict whether it will rain today.
Predict your mood tomorrow
Answer: The following problems are classification problems:

• Predict which team will win a tournament.


• Predict whether it will rain today.

The other problems are:

• Predict the runs a cricketer will score in a particular match is a regression


problem.
• Predict your mood tomorrow is not a machine learning problem.

3). Which of the following is a regression task?

Predicting the monthly sales of a cloth store in rupees.


Predicting if a user would like to listen to a newly released song or not
based on historical data.
Predicting the confirmation probability (in fraction) of your train ticket
whose current status is waiting list based on historical data.
Predicting if a patient has diabetes or not based on historical medical
records.
Predicting if a customer is satisfied or unsatisfied from the product
purchased from ecommerce website using the the reviews he/she wrote for
the purchased product.

Answer: The following problem is a regression task:

• Predicting the monthly sales of a cloth store in rupees.

The other problems are:

• Predicting if a user would like to listen to a newly released song or not based on
historical data is a classification problem.
• Predicting the confirmation probability (in fraction) of your train ticket whose
current status is waiting list based on historical data is a regression problem.
• Predicting if a patient has diabetes or not based on historical medical records is
a classification problem.
• Predicting if a customer is satisfied or unsatisfied from the product purchased
from ecommerce website using the the reviews he/she wrote for the purchased
product is a classification problem.
4). Which of the following is an unsupervised learning task?
Group audio files based on language of the speakers.
Group applicants to a university based on their nationality.
Predict a student’s performance in the final exams.
Predict the trajectory of a meteorite.

Answer: The following problem is an unsupervised learning task:

• Group audio files based on language of the speakers.

The other problems are:

• Group applicants to a university based on their nationality is an unsupervised


learning task.
• Predict a student’s performance in the final exams is a supervised learning task.
• Predict the trajectory of a meteorite is not a machine learning problem

5). Which of the following is a categorical feature?


Number of rooms in a hostel.
Gender of a person
Your weekly expenditure in rupees.
Ethnicity of a person
Area (in sq. centimeter) of your laptop screen.
The color of the curtains in your room.
Number of legs an animal.
Minimum RAM requirement (in GB) of a system to play a game like
FIFA, DOTA

Answer: The following features are categorical features:

• Gender of a person
• Ethnicity of a person
• The color of the curtains in your room
• Number of legs an animal

The other features are numerical features:


• Number of rooms in a hostel
• Your weekly expenditure in rupees
• Area (in sq. centimeter) of your laptop screen
• Minimum RAM requirement (in GB) of a system to play a game like FIFA, DOTA

6). Which of the following is a reinforcement learning task?


Learning to drive a cycle
Learning to predict stock prices
Learning to play chess
Leaning to predict spam labels for e-mails
Answer: The following problem is a reinforcement learning task:

• Learning to play chess.

The other problems are:

• Learning to drive a cycle is not a machine learning problem.


• Learning to predict stock prices is a supervised learning problem.
• Leaning to predict spam labels for e-mails is a supervised learning problem.

7). Let X� and Y� be a uniformly distributed random variable over the


interval [0,4][0,4] and [0,6][0,6] respectively. If X� and Y� are independent
events, then compute the probability, P(max(X,Y)>3)�(���(�,�)>3)

1/6

5/6

2/3

1/2

2/6

5/8
None of the above
Answer: The probability that max(X,Y)>3 can be calculated as follows:
P(max(X,Y)>3) = 1 - P(max(X,Y)<=3)
Since X and Y are uniformly distributed random variables over the interval [0,4] and [0,6]
respectively and are independent events, we can use the following formula:
P(max(X,Y)<=k) = P(X<=k) * P(Y<=k)
where k is a constant.
Therefore,
P(max(X,Y)<=3) = P(X<=3) * P(Y<=3)
P(X<=3) = 3/4 (since X is uniformly distributed over [0,4])
P(Y<=3) = 1/2 (since Y is uniformly distributed over [0,6])
So,
P(max(X,Y)<=3) = (3/4) * (1/2) = 3/8
Therefore,
P(max(X,Y)>3) = 1 - P(max(X,Y)<=3)
= 1 - 3/8
= 5/8
Therefore, the probability that max(X,Y)>3 is 5/8.

8). Find the mean of 0-1 loss for the given predictions:
Answer: The mean of 0-1 loss for the given predictions can be calculated as follows:

Let y_i be the true label and y_i_hat be the predicted label.
0-1 loss is defined as:
L(y_i, y_i_hat) = 1 if y_i != y_i_hat and 0 otherwise.
Therefore, the 0-1 loss for the given predictions is:
L(1, 1) = 0
L(0, 0) = 0
L(1, 0) = 1
L(0, 1) = 1
The mean of 0-1 loss is defined as:
mean(L(y_i, y_i_hat)) = (1/n) * sum(L(y_i, y_i_hat))
where n is the number of predictions.
Therefore,
mean(L(y_i, y_i_hat)) = (1/4) * (L(1, 1) + L(0, 0) + L(1, 0) + L(0, 1))
= (1/4) * (0 + 0 + 1 + 1)
= (1/4) * 2
= 0.5
Therefore, the mean of 0-1 loss for the given predictions is 0.5.

9), Which of the following statements are true? Check all that apply.
A model with more parameters is more prone to overfitting and typically
has higher variance.
If a learning algorithm is suffering from high bias, only adding more
training examples may not improve the test error significantly.
When debugging learning algorithms, it is useful to plot a learning curve
to understand if there is a high bias or high variance problem.
If a neural network has much lower training error than test error, then
adding more layers will help bring the test error down because we can fit
the test set better.

Answer: The following statements are true:


• A model with more parameters is more prone to overfitting and typically has
higher variance.
• When debugging learning algorithms, it is useful to plot a learning curve to
understand if there is a high bias or high variance problem.

The following statement is false:

• If a neural network has much lower training error than test error, then adding
more layers will help bring the test error down because we can fit the test set
better.

The following statement is partially true:

• If a learning algorithm is suffering from high bias, only adding more training
examples may not improve the test error significantly. This statement is partially
true because adding more training examples may not always help improve the
test error significantly but it can help in some cases.

10). Bias and variance are given by:

E[f^(x)]−f(x),E[(E[f^(x)]−f^(x))2]�[�^(�)]−�(�),�[(�[�^(�)]−�^(�))2]

E[f^(x)]−f(x),E[(E[f^(x)]−f^(x))]2�[�^(�)]−�(�),�[(�[�^(�)]−�^(�))]2

(E[f^(x)]−f(x))2,E[(E[f^(x)]−f^(x))2](�[�^(�)]−�(�))2,�[(�[�^(�)]−�^(�))2]

(E[f^(x)]−f(x))2,E[(E[f^(x)]−f^(x))

Answer: Bias and variance are given by:


E[f(x)]−f(x),E[(E[f(x)]−f^(x))2]
where f(x) is the true function and f^(x) is the predicted function

You might also like