Final exam
Machine Learning Fundamentals
Before you start
- 20 questions, drawn at random from a pool of 38.
- Pass mark: 70%. Your final score is 30% practice + 70% exam.
- No time limit, but finish within 3 hours. You can move between questions before you submit.
- Failed? Review the lessons and try again: every attempt gets a new set of questions.
Question 1 of 20Sort into groups
Classify each task as regression, classification or clustering.
Tap an item, then tap its group (or drag it there).
Question 2 of 20Choose one
Why should you measure a simple baseline before training complex models?
Question 3 of 20Work it out
Predictions are 5, 8 and 2; actual values are 3, 8 and 5. What is the mean absolute error?
Question 4 of 20What would you do?
What would you do?
You are predicting whether patients will develop a condition within a year. One candidate feature is "number of specialist visits for this condition in the following year." What should you do with it?
Question 5 of 20Select all that apply
Which practices help prevent data leakage? Select all that apply.
Select all that apply.
Question 6 of 20Work it out
A feature has mean 120 and standard deviation 15 in the training data. What is the standardized value (z-score) of 90?
Question 7 of 20True or false
One-hot encoding is generally preferred over integer encoding for nominal categories such as city names in a linear model.
Question 8 of 20Work it out
A linear model is ŷ = 4x₁ − 2x₂ + 10. What does it predict for x₁ = 3 and x₂ = 5?
Question 9 of 20Work it out
For actual values 2, 4 and 6 and predictions 3, 4 and 3, what is the mean squared error?
Question 10 of 20Choose one
Which statement about extrapolation with a linear regression model is correct?
Question 11 of 20Work it out
Loss L(w) = (w − 3)² has derivative 2(w − 3). Starting at w = 1 with learning rate 0.25, what is w after one gradient descent step?
Question 12 of 20Choose one
During training, the loss oscillates and grows larger with each epoch until it becomes NaN. What is the most likely fix?
Question 13 of 20Match the pairs
Match each optimization term to its meaning.
Tap an answer, then tap the place where it belongs (or drag it there).
- Learning rate
- Epoch
- Mini-batch
- Gradient
Question 14 of 20Work it out
A dataset has 12,000 training examples and a batch size of 400. How many parameter updates occur in 5 epochs?
Question 15 of 20Choose one
What does the sigmoid function do in logistic regression?
Question 16 of 20True or false
In logistic regression with a 0.5 threshold, the decision boundary is where the weighted sum z equals 0.
Question 17 of 20Choose one
A logistic regression weight is −0.7, and e−0.7 ≈ 0.5. How should it be interpreted?
Question 18 of 20Work it out
A decision tree node contains 9 examples of class A and 1 example of class B. What is its Gini impurity?
Question 19 of 20Select all that apply
Which statements about k-nearest neighbors are true? Select all that apply.
Select all that apply.
Question 20 of 20Choose one
How does gradient boosting differ from a random forest?
Question 21 of 20Work it out
A classifier has TP = 30, FP = 10, FN = 20 and TN = 140. What is its recall? Give a decimal between 0 and 1.
Question 22 of 20Work it out
Using the same counts (TP = 30, FP = 10, FN = 20), what is the F1 score? Round to two decimals.
Question 23 of 20What would you do?
What would you do?
A model screens blood samples for a serious but treatable disease. Positive results get a cheap, accurate follow-up test. How should the decision threshold be set?
Question 24 of 20True or false
An AUC of 0.5 means the classifier ranks positives above negatives no better than random guessing.
Question 25 of 20Sort into groups
Diagnose each pattern of training and validation error.
Tap an item, then tap its group (or drag it there).
Question 26 of 20Choose one
A learning curve shows training and validation errors converging quickly at a high level. Which action is least likely to help?
Question 27 of 20Work it out
With weights (2, −1, 3) and λ = 0.5, what is the L2 regularization penalty λ × Σw²?
Question 28 of 20True or false
L2 regularization typically sets many weights exactly to zero, performing feature selection.
Question 29 of 20Work it out
A grid search over 4 values of λ and 3 values of tree depth uses 10-fold cross-validation. How many models are trained?
Question 30 of 20Spot the mistake
A student describes their model selection procedure. Which steps compromise the honesty of the final test score? Click them.
Question 31 of 20Choose one
What is the main advantage of stratified k-fold cross-validation for an imbalanced classification problem?
Question 32 of 20Put in order
Put the k-means steps in order.
Drag the items, or use the arrow buttons, to put them in order.
- Pick k and initialize centroids
- Assign each point to its nearest centroid
- Repeat until assignments no longer change
- Recompute each centroid as the mean of its points
Question 33 of 20Work it out
PCA components explain 50%, 20%, 12%, 9%, 5% and 4% of the variance. How many components are needed to keep at least 90% of the variance?
Question 34 of 20Choose one
Which statement about clustering is correct?
Question 35 of 20Work it out
A dense neural network layer has 10 inputs and 5 neurons, each with a bias. How many parameters does it have?
Question 36 of 20True or false
Without nonlinear activation functions, a deep neural network with many layers is equivalent to a single linear model.
Question 37 of 20Match the pairs
Match each deployment problem to its description.
Tap an answer, then tap the place where it belongs (or drag it there).
- Covariate drift
- Concept drift
- Training-serving skew
- Feedback loop
Question 38 of 20Select all that apply
Which practices support responsible machine learning in high-stakes decisions? Select all that apply.
Select all that apply.