- Foundation
- About 25 min
- 15 practice questions
Final self-assessment: Machine learning basics
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, pressure and wind speed. Which statement is correct?
- Rainfall is a feature and humidity is the label
- Humidity, 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, pressure, wind speed); the label is the quantity it must predict (rainfall). Because rainfall is a number, this is also a regression task.
-
2. A dataset of 2,500 labelled photos is split 80% for training and 20% for testing. The model gets 450 of the test photos right. What is its test accuracy?
- 90%
- 18%
- 80%
- 75%
Show answer
Answer: A. Test set = 20% of 2,500 = 500 photos. Accuracy = 450 ÷ 500 × 100 = 90%.
-
3. Which statement best describes machine learning compared with ordinary programming?
- ML is given rules and produces data
- ML needs no examples, only rules
- ML can only add and subtract numbers
- ML is given data and correct answers and produces the rules (a model)
Show answer
Answer: D. In ordinary programming, data and rules go in and answers come out. In machine learning, data and answers go in and the learned rules (the model) come out.
-
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 learns from rewards.
-
5. Which pair is correctly matched?
- Clustering - needs labelled data
- Reinforcement learning - learns from rewards by acting in an environment
- Regression - predicts a category
- Classification - finds groups without labels
Show answer
Answer: B. Reinforcement learning is defined by an agent acting in an environment and learning from rewards. Clustering works without labels, regression predicts numbers and classification predicts categories from labelled data.
-
6. 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 8
- 50 and 50
- 30 and 22
- 20 and 14
Show answer
Answer: A. 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.
-
7. 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.
-
8. Using k-NN, a new point's five nearest neighbours are labelled A, B, A, B, B. With k = 3, the three nearest (in order) are A, B, A. What are the predictions for k = 3 and k = 5?
- A for both
- B for both
- B for k = 3 and A for k = 5
- A for k = 3 and B for k = 5
Show answer
Answer: D. 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.
-
9. Customers' monthly spending (in thousands of rupees) is 1, 3, 9 and 11. k-means with k = 2 starts with centres 1 and 11. After one assign-and-update round, where are the centres?
- 1 and 11
- 2 and 10
- 3 and 9
- 4 and 8
Show answer
Answer: B. Assign: 1 and 3 are nearer centre 1; 9 and 11 are nearer centre 11. Update: (1 + 3) ÷ 2 = 2 and (9 + 11) ÷ 2 = 10. The new centres are 2 and 10, and another round changes nothing.
-
10. A neuron has inputs 3 and 2, weights −1 and 0.5, and bias 0, with ReLU activation. What is its output?
- 0
- −2
- 4
- 1
Show answer
Answer: A. Weighted sum = (3 × −1) + (2 × 0.5) + 0 = −3 + 1 = −2. ReLU outputs 0 for any negative total, so the output is 0.
-
11. Using the update rule new w = w + learning rate × error × input, with w = 2, input 3, correct answer 9 and learning rate 0.1, what is the new w? (Prediction = w × input; error = answer − prediction.)
- 2.3
- 2.6
- 2.9
- 3.8
Show answer
Answer: C. Prediction = 2 × 3 = 6. Error = 9 − 6 = 3. New w = 2 + 0.1 × 3 × 3 = 2 + 0.9 = 2.9. The new prediction 2.9 × 3 = 8.7 is closer to 9.
-
12. In the sentence 'She sat on the bank and watched the boats', a transformer uses which mechanism to work out that 'bank' means a riverside?
- Clustering
- Attention to other words such as 'boats'
- A larger test set
- Reinforcement rewards
Show answer
Answer: B. Transformers use attention: while processing a word, the model weighs how relevant every other word in the passage is. Attending to 'boats' points to the riverside meaning of 'bank'.
-
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?
- Overfitting
- A good fit
- Underfitting
- Data drift
Show answer
Answer: C. M's scores are similar but low on both training and test data, and a more flexible model does much better on both. That shows M is too simple to capture the pattern: underfitting. Overfitting would show a high training score and 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?
- 60% and 75%
- 75% and 60%
- 30% and 40%
- 98% and 60%
Show answer
Answer: A. Precision = real frauds among flagged = 30 ÷ 50 = 60%. Recall = frauds caught among all frauds = 30 ÷ 40 = 75%.
-
15. 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?
- Cleaning; overfitting
- Testing; underfitting
- Monitoring; data drift
- Collecting; reinforcement
Show answer
Answer: C. 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 data.
Where to revise: questions 1-3: lesson 1 (what machine learning is, features, labels, train-test split); questions 4-6: lesson 2 (types of learning); questions 7-9: lesson 3 (linear regression, k-NN, k-means); questions 10-12: lesson 4 (neurons, training, transformers); questions 13-15: lesson 5 (overfitting, underfitting, precision, recall and the workflow).
Sign in to keep track of the lessons you finish.