Sample questions
Question 1Easy
In simple linear regression y = 2x + 1, what is the predicted y for x = 4?
- 9
- 8
- 10
- 7
Answer: A. 9
Explanation
y = 2*4 + 1 = 9.
Step-by-step solution
- Plug x = 4.
- 2*4 = 8.
- 8 + 1 = 9.
Why the other options are wrong
- B. Forgets the intercept.
- C. Adds 2 instead of 1.
- D. Computes 2*3+1 using x-1.
Question 2Easy
In simple linear regression y = a + b x, the parameter b represents
- the value of y when x is 0
- the change in y for a one-unit increase in x
- the average of x
- the error of the model
Answer: B. the change in y for a one-unit increase in x
Explanation
The slope b is the expected change in y per unit change in x; a is the intercept.
Step-by-step solution
- In y = a + b x, a is the intercept (value of y when x = 0).
- B is the slope.
- The slope is the change in y for a one-unit increase in x, so the answer is option B.
Why the other options are wrong
- A. This describes the intercept a, not the slope b.
- C. The average of x is not a model parameter.
- D. The error is the residual, not a parameter of the line.
Tip: Slope = change in y per unit change in x; intercept = y when x = 0.
Question 3Medium
Logistic regression outputs a probability by applying which function to a linear score?
- ReLU
- sigmoid
- tanh followed by argmax only
- identity
Answer: B. sigmoid
Explanation
The sigmoid 1/(1+e^-z) maps any real score to (0,1). For z = 0 it gives 0.5.
Step-by-step solution
- Logistic regression computes a linear score z.
- The sigmoid function 1 / (1 + e^(−z)) maps z to a probability between 0 and 1.
- So the answer is sigmoid.
Why the other options are wrong
- A. ReLU outputs values from 0 upwards, not a probability between 0 and 1.
- C. Tanh gives values from −1 to 1, and argmax is not a probability function.
- D. The identity function gives the raw score, which can be outside 0 to 1.
Tip: Logistic regression = linear score + sigmoid.
Question 4Medium
Two variables have a perfect negative linear relationship. Their Pearson correlation is
- -1
- 0
- 1
- -0.5
Answer: A. -1
Explanation
Perfect inverse linear dependence gives r = -1. r = 0 means no linear relationship.
Step-by-step solution
- Pearson correlation runs from −1 to +1.
- A perfect negative linear relationship has all points on a downward line.
- So the correlation is −1.
Why the other options are wrong
- B. 0 means no linear relationship.
- C. +1 means a perfect positive relationship.
- D. −0.5 is a moderate negative correlation, not a perfect one.
Tip: r = +1 perfect up, −1 perfect down, 0 no linear link.
Question 5Medium
Ridge regression adds which penalty to the loss?
- The sum of absolute coefficients
- The number of samples multiplied by the learning rate
- The sum of residuals
- The sum of squared coefficients (L2)
Answer: D. The sum of squared coefficients (L2)
Explanation
The L2 penalty shrinks coefficients smoothly towards zero without usually making them exactly zero.
Step-by-step solution
- Loss = squared error + lambda * sum(w^2).
- Larger lambda means more shrinkage.
- Weights stay small but non-zero.
Why the other options are wrong
- A. That is Lasso (L1).
- B. Not part of the penalty.
- C. That is part of the loss, not the penalty.
Question 6Medium
In ordinary least squares (OLS), the line is chosen to minimise
- The sum of absolute residuals
- The number of misclassified points
- The largest single residual
- The sum of squared residuals
Answer: D. The sum of squared residuals
Explanation
OLS picks coefficients that minimise the sum of (y - y_hat)^2.
Step-by-step solution
- Residual = y - y_hat.
- Square and sum them.
- Choose coefficients that minimise it.
Why the other options are wrong
- A. That is least absolute deviations.
- B. That is for classification.
- C. That is a minimax fit, not OLS.
Question 7Medium
Which problem occurs when two input features in linear regression are almost perfectly correlated?
- Multicollinearity, which makes coefficients unstable
- Heteroscedasticity only
- Perfect fit guaranteed
- Underfitting that appears only because there are too many training samples
Answer: A. Multicollinearity, which makes coefficients unstable
Explanation
Coefficient estimates swing wildly because the model cannot separate each feature's individual effect.
Step-by-step solution
- Two features carry the same signal.
- Many coefficient combos fit equally well.
- Estimates become unstable.
Why the other options are wrong
- B. That is non-constant error variance.
- C. Correlation does not guarantee a perfect fit.
- D. Multicollinearity is about correlated features.
Question 8Medium
Ordinary least squares chooses the parameters that minimise
- the sum of absolute residuals
- the largest residual
- the number of features
- the sum of squared residuals
Answer: D. the sum of squared residuals
Explanation
OLS minimises the sum of squared differences between actual and predicted values.
Step-by-step solution
- Ordinary least squares fits a line by minimising the error function.
- The error used is the sum of squared residuals.
- So the answer is the sum of squared residuals.
Why the other options are wrong
- A. Absolute residuals are used by least absolute deviation methods, not OLS.
- B. The largest residual is used in minimax fitting, not OLS.
- C. The number of features is a model choice, not something OLS minimises.
Tip: OLS = least squares = minimise the sum of squared errors.
Question 9Hard
Data points (1,2), (2,4), (3,6) are fit by y = mx + c using least squares. What are m and c?
- m = 1, c = 1
- m = 2, c = 0
- m = 2, c = 1
- m = 0, c = 4
Answer: B. m = 2, c = 0
Explanation
All three points lie exactly on y = 2x, so the residuals are zero.
Step-by-step solution
- Slopes: (4-2)/(2-1) = 2.
- Intercept: 2 - 2*1 = 0.
- Check (3,6): 2*3 = 6.
Why the other options are wrong
- A. This line gives (1,2), (2,3), (3,4), not the data.
- C. This line is shifted by 1 from every point.
- D. A horizontal line at the mean ignores the clear trend.
Question 10Hard
For the points (1,2), (2,4), (3,5), (4,8) the best-fit line is y = 1.9x. The R^2 value is approximately
- 0.96
- 0.90
- 1.00
- 0.76
Answer: A. 0.96
Explanation
Residuals are 0.1, 0.2, -0.7, 0.4, so SSE = 0.70; total sum of squares = 18.75. Then R^2 = 1 - 0.7/18.75 = 0.963.
Step-by-step solution
- The line y = 1.9x gives predictions 1.9, 3.8, 5.7 and 7.6.
- Residuals sum of squares = 0.01 + 0.04 + 0.49 + 0.16 = 0.70; total sum of squares about the mean 4.75 is 18.75.
- R² = 1 − 0.70 / 18.75 ≈ 0.963, which is about 0.96.
Why the other options are wrong
- B. 0.90 is too low for these close points; the residuals are small.
- C. 1.00 would need zero residuals, but the points do not sit exactly on the line.
- D. 0.76 does not match the sum of squares calculation.
Tip: R² = 1 − (residual sum of squares / total sum of squares).
Practise all 15 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →