Professional Documents
Culture Documents
Introduction To Machine Learning Week1 Explanation
Introduction To Machine Learning Week1 Explanation
• Predicting credit approval based on historical data: In this case, the algorithm
is provided with historical data of credit applications, including information about
applicants and whether their applications were approved or denied. The goal is to
train the algorithm to predict whether a new credit application should be
approved or not based on the historical data.
The other options mentioned involve tasks that are not inherently supervised learning
problems:
Overall, the clearest example of a supervised learning problem from the given options is
"Predicting credit approval based on historical data."
Question 2.
Which of the following are classification problems?
Answer: Classification problems involve predicting a discrete class label or category for a
given input. Among the options provided, the following are classification problems:
Question 3
Which of the following is a regression task?
In summary, only "Predicting the monthly sales of a cloth store in rupees" is a regression
task. The rest are binary classification tasks, except for the "confirmation probability"
prediction, which could be treated as a regression problem with elements of
classification.
Question 4.
Which of the following is an unsupervised learning task?
To summarize, only "Group audio files based on the language of the speakers" is an
unsupervised learning task from the given options.
Question 5.
Which of the following is a categorical feature?
To summarize, the categorical features among the given options are: Gender of a
person, Ethnicity of a person, The color of the curtains in your room, Number of legs an
animal.
Question 6.
Which of the following is a reinforcement learning task?
Answer: The reinforcement learning task among the options provided is:
• Learning to drive a cycle: This is a task that can be approached using supervised
learning (with labeled data) or unsupervised learning (finding patterns in data
without explicit labels).
• Learning to predict stock prices: This is a task usually tackled using time-series
analysis, econometrics, or machine learning techniques, but it is not considered a
reinforcement learning task. In predicting stock prices, the model typically learns
patterns and relationships in historical stock price data to make predictions about
future prices.
• Learning to predict spam labels for emails: This is a supervised learning task.
The model can be trained on labeled data (emails labeled as spam or not spam)
to predict whether new, unseen emails are spam or not. It does not involve the
agent interacting with an environment to maximize rewards.
In summary, "Learning to play chess" is the reinforcement learning task from the given
options.
Question 7.
1/6
5/6
2/3
1/2
2/6
5/8
None of the above
Question 8.
Find the mean of 0-1 loss for the given predictions:
11
00
1.51.5
0.5
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.
Question 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.
• 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: This statement is not necessarily true. If a neural network has
a significantly lower training error than the test error, it indicates overfitting, and
adding more layers may worsen the problem by increasing model complexity. It
is more appropriate to consider techniques like regularization or reducing the
network's size to improve generalization rather than blindly adding more layers.
Question 10.
Bias and variance are given by:
E[f^(x)]−f(x),E[(E[f^(x)]−f^(x))2]
E[f^(x)]−f(x),E[(E[f^(x)]−f^(x))]2
(E[f^(x)]−f(x))2,E[(E[f^(x)]−f^(x))2]
(E[f^(x)]−f(x))2,E[(E[f^(x)]−f^(x))]2
Answer: Bias
and variance are measures that help us understand the performance of a
machine learning model.
The variance measures the variability or spread of the model's predictions around their
average (E[f^(x)]), which indicates how sensitive the model is to changes in the training
data. A higher variance suggests that the model is overfitting to the noise in the training
data.