- Foundation
- About 25 min
- 15 practice questions
Final self-assessment: Machine learning fundamentals
Test yourself on the whole course: 15 questions with answers explained.
If something looks wrong, please tell us.
Attempt all 15 questions in one sitting of about 25 minutes, writing down the working for the numerical ones. The questions mix ideas from all five lessons and are a little harder than the lesson checks. Check your answers only after you finish, and read every explanation, including those for questions you got right.
Final self-assessment
-
1. A weather app predicts tomorrow's rainfall in millimetres using today's humidity, air pressure and wind speed. Which statement is correct?
- Rainfall is a feature and humidity is the label
- Humidity, air pressure and wind speed are features; rainfall is the label
- All four quantities are labels
- There are no features because the data is about weather
Show answer
Answer: B. Features are the inputs the model uses (humidity, air pressure, wind speed); the label is the quantity it must predict (rainfall). Because rainfall is a number, this is also a regression task.
-
2. Daily visitors at a post office are 30, 34, 36, 40 and 300 (a pension-day rush), and one day's count is missing. Which statement about filling the gap is correct?
- The mean is 88 and the median is 36; the median is the safer fill
- The mean is 36 and the median is 88; the mean is the safer fill
- The mean is 88 and the median is 36; the mean is the safer fill
- The mean is 440 and the median is 36; the median is the safer fill
Show answer
Answer: A. Mean = (30 + 34 + 36 + 40 + 300) ÷ 5 = 440 ÷ 5 = 88 (440 is the total, not the mean). Sorted, the middle of the five values is 36, so the median is 36. The single extreme value drags the mean far above four of the five days, so the median of 36 is the more typical and safer fill.
-
3. A loan model was trained only on applicants from cities. It performs badly for rural applicants. What is the main cause?
- The test set was too large
- The categories were one-hot encoded
- The training data did not represent rural applicants
- The model was deployed too early in the day
Show answer
Answer: C. A model learns only from the examples it sees. With no rural applicants in the training data, it has not learned their patterns: garbage in, garbage out. The fix is data that represents everyone the model will serve, and checking results for each group.
-
4. A telecom company wants to predict whether each customer will leave next month ('leave' or 'stay'), using records of past customers who did leave or stay. Which type of task is this?
- Regression
- Clustering
- Supervised classification
- Reinforcement learning
Show answer
Answer: C. The answer is a category (leave or stay) and past records provide labels, so it is supervised classification. Regression would predict a number; clustering uses no labels; reinforcement learning learns from rewards.
-
5. A model has learned: electricity bill = 7 × units used + 150. Ravi's bill is predicted to be ₹1,200. How many units does the model assume he used?
- 171
- 200
- 1,050
- 150
Show answer
Answer: D. Set up the equation: 1,200 = 7 × units + 150. Subtract 150: 7 × units = 1,050. Divide by 7: units = 150. Check: 7 × 150 + 150 = 1,050 + 150 = ₹1,200.
-
6. Using k-NN, a new point's five nearest neighbours, from nearest to farthest, are labelled A, B, A, B, B. What are the predictions for k = 3 and for k = 5?
- A for both
- A for k = 3 and B for k = 5
- B for both
- B for k = 3 and A for k = 5
Show answer
Answer: B. k = 3: the three nearest are A, B, A, so A wins 2 to 1. k = 5: all five vote A, B, A, B, B, so B wins 3 to 2. The choice of k changes the answer.
-
7. The values 1, 2, 6, 10 and 11 are clustered by k-means with k = 2, starting centres 1 and 2. Where are the centres when the algorithm stops?
- 1 and 7.25
- 2 and 10
- 1.5 and 9
- 3 and 8
Show answer
Answer: C. Round 1: 1 joins centre 1; 2, 6, 10 and 11 are nearer centre 2. Update: 1 and (2 + 6 + 10 + 11) ÷ 4 = 29 ÷ 4 = 7.25. Round 2: 2 is nearer 1 (distance 1) than 7.25, while 6, 10 and 11 stay with 7.25. Update: (1 + 2) ÷ 2 = 1.5 and (6 + 10 + 11) ÷ 3 = 27 ÷ 3 = 9. Round 3: 6 is 4.5 from 1.5 and 3 from 9, so nothing changes. The algorithm stops with centres 1.5 and 9.
-
8. A district library groups its members by borrowing habits, with no groups defined in advance. Which statement is correct?
- It is classification, because each member ends up in a group
- It is clustering; with no labels, a person judges whether the groups are useful
- It is regression, because borrowing counts are numbers
- It cannot be done without a labelled test set
Show answer
Answer: B. Grouping examples without predefined labels is clustering, an unsupervised task. There are no true labels to compare with, so people judge whether the groups make sense and are useful. Classification and regression both need labelled examples.
-
9. A game agent gets +50 for winning and −3 for every move. Strategy P wins in 10 moves; strategy Q wins in 14 moves. What are the total rewards of P and Q?
- 20 and 14
- 30 and 22
- 50 and 50
- 20 and 8
Show answer
Answer: D. P: 50 − (10 × 3) = 50 − 30 = 20. Q: 50 − (14 × 3) = 50 − 42 = 8. So the totals are 20 and 8, and the agent learns to prefer P.
-
10. A dataset of 4,000 labelled records is split 70% training, 15% validation and 15% test. The final model gets 540 of the test records right. What is its test accuracy?
- 77%
- 13.5%
- 90%
- 85%
Show answer
Answer: C. Test set = 15% of 4,000 = 600 records. Accuracy = 540 ÷ 600 × 100 = 90%. Dividing 540 by all 4,000 records would wrongly give 13.5%.
-
11. A team tries k = 1, 3, 5 and 7 for k-NN and must pick one. Which approach is correct?
- Pick by test-set score, because the test set gives the most honest score
- Pick by training-set score; k = 1 scores best there, so choose it
- Any choice is fine, because k is learned automatically during training
- Pick by validation-set score, keeping the test set untouched for one final check
Show answer
Answer: D. k is a hyperparameter, chosen by comparing scores on the validation set. Choosing with the test set would make it part of model building, so its score would no longer be honest. With k = 1 each training example is its own nearest neighbour, so a training score near 100% shows memory, not learning.
-
12. A crop-disease model worked well when launched but becomes less accurate over two seasons as new pest varieties appear. Which workflow step should catch this, and what is the effect called?
- Monitoring; data drift
- Cleaning; overfitting
- Testing; underfitting
- Collecting; reinforcement
Show answer
Answer: A. After deployment the model must be monitored. When the real-world data changes over time and accuracy falls, that is data drift; the remedy is to retrain on newer labelled data.
-
13. Model M scores 70% on training data and 69% on test data, while a more flexible model N scores 92% on training and 90% on test. What best describes model M?
- Underfitting
- Overfitting
- A good fit
- Data drift
Show answer
Answer: A. M's scores are close together but low on both training and test data, and a more flexible model does much better on both. M is too simple to capture the pattern: underfitting. Overfitting would show a high training score with a much lower test score.
-
14. Among 2,000 loan applications, 40 are fraudulent. A model flags 50 applications, of which 30 are fraudulent. What are its precision and recall?
- 75% and 60%
- 60% and 75%
- 30% and 40%
- 98% and 60%
Show answer
Answer: B. TP = 30, FP = 50 − 30 = 20, FN = 40 − 30 = 10. Precision = TP ÷ (TP + FP) = 30 ÷ 50 = 60%. Recall = TP ÷ (TP + FN) = 30 ÷ 40 = 75%. So precision is 60% and recall is 75%.
-
15. A screening test is used on 1,000 people, of whom 50 are ill. It gives TP = 40, FN = 10, FP = 60 and TN = 890. What are its accuracy and recall?
- 80% and 40%
- 93% and 40%
- 89% and 80%
- 93% and 80%
Show answer
Answer: D. Accuracy = (TP + TN) ÷ total = (40 + 890) ÷ 1,000 = 930 ÷ 1,000 = 93%. Recall = TP ÷ (TP + FN) = 40 ÷ 50 = 80%. (Precision would be 40 ÷ (40 + 60) = 40%, a different measure.)
Where to revise: questions 1-3: lesson 1 (data, features, labels and cleaning); questions 4-6: lesson 2 (supervised learning, linear regression, decision trees and k-NN); questions 7-9: lesson 3 (unsupervised learning, k-means and reinforcement learning); questions 10-12: lesson 4 (training, validation and test sets, the workflow and data drift); questions 13-15: lesson 5 (overfitting, underfitting, the confusion matrix, precision and recall).
Sign in to keep track of the lessons you finish.