Font size
WorksheetsML-Revised
Total questions: 25
Worksheet time: 17mins
Supervised learning requires:
A. No labels
B. Only images
C. Labeled input-output pairs
D. Rewards and penalties
3. Which problem is solved using regression?
A. Predict whether an email is spam
B. Predict price of a house
C. Classify animals into categories
D. Recognize handwritten digits
Polynomial regression can model:
A. Only linear patterns
B. Only categorical outputs
C. Nonlinear relationships
D. Reinforcement learning policies
The cost function in linear regression is usually:
A. Accuracy
B. Entropy
C. Mean Squared Error
D. Gain Ratio
High bias usually leads to:
A. Underfitting
B. Overfitting
C. Better generalization
D. High training accuracy
Which evaluation metric is most sensitive to outliers?
A. MAE
B. MSE
C. Accuracy
D. Recall
A supermarket wants to predict next month’s total sales. Which ML method should they use? answer in small letters
(a)
You are predicting house prices but the model is too simple and missing patterns. What problem is this?
Underfitting
overfitting
Noise
MSE
A polynomial regression (degree 8) fits perfectly on training data but performs poorly on test data. What is happening?
(a)
Which metric is best for a model where outliers matter a lot, such as predicting medical dosage errors?
MSE
MAE
LSE
RMSE
2. Perform 2 steps of gradient descent
Given:
Dataset: (x = 1, y = 3)
Initial values: b=0 m=0
Learning rate: α=0.5
answer in small letter (m=? and b=?)
(a)
Hypothesis:
h(x)=b+m1x1+m2x2
Given:
Training example: (x1=2, x2=3) y=10
Parameters: θ0=1,θ1=1,θ2=1
Learning rate: α=0.1
Perform one gradient descent update.
answer format (b=?, m1=?, m2=?)
(a)
Compute LSE
Predictions: [3, 5, 7]
Actual values: [2, 6, 7]
(a)
An e-commerce website wants to group customers into segments (e.g., bargain hunters, loyal customers, high spenders) based only on their purchase history and browsing behavior.
Which type of ML will you use?
Supervised
Unsupervised
A data scientist builds a linear regression model to predict customer spending using many complex features: browsing patterns, device type, time of day, and more. The model has very low training accuracy and low test accuracy.
(a) Is this or ? Explain.
underfitting
overfitting
A bank uses logistic regression to predict whether a customer will default on a loan.
They use 50 features (income, age, number of loans, spending patterns, etc.).
After training without regularization, the model overfits and gives unstable predictions on new customers. If the bank wants a simpler model with fewer active features, which type of regularization is better
L1
L2
In L2 regularization (Ridge), the penalty term added to the loss is:
A. λ∑∣wi∣
B. λ∑wi^2
C. λ∑∣yi−y^i∣
D. λ∑(yi−yi)^2
Which statement is true about L2 regularization?
A. It forces some weights to become exactly zero.
B. It tends to keep all weights small but non-zero.
C. It cannot be used with gradient descent.
D. It is only applied to the bias term.
Regularization is mainly used to control:
A. Bias
B. Variance
C. Learning rate
D. Optimization algorithm
Assume you have a model with weights w=[2,−4,1].
Compute the value of the L1 and L2 penalty terms for λ = 0.5:
(a) λ∑∣wi∣
(b) λ∑wi^2
write your answers in format (a=?, b=?)
(a)
Model:
h(x)=4+2x
Find prediction for x=7
(a)
he output of the logistic (sigmoid) function always lies between:
A. −∞ to +∞
B. −1 to +1
C. 0 to 1
D. 0 to ∞
Logistic regression uses which of the following as its activation function?
A. ReLU
B. Sigmoid
C. Tanh
D. Softmax
The logistic (sigmoid) function is:
σ(z)=1/1+e^(-z) compute σ(z) where z=0.5 and e=2.71
write your answers in numbers in two decimal format.
(a)
A logistic regression model is:
z=−2+0.8x1+0.5x2
For a person with x1=3 and x2=2
(a) Compute z.
(b)sigmoid function
write your answer in format (a=?, b=?)
answers having decimal valued should be written in 2 decimal format
(a)
