Courses / Computer Science XII (HSSC-II) – FBISE Complete SLO-Based Course
Unit 4 Review, Situational Quiz and Unit Test
Unit 4 – Data and Analysis · 45 min read · 16 MCQs to check yourself
Unit 4: Data and Analysis – review
This unit carries about 16% of the marks in the FBISE model paper (Table of Specifications).
SLO checklist – tick each one you can do
| SLO | Students should be able to… | Lesson(s) |
|---|---|---|
| CS-12-D-01 | Analyse data and identify key model performance metrics of real-world machine-learning models | 4.1, 4.2 |
| CS-12-D-02 | Explain and create a data visualisation using SQL, Python or R; data storytelling | 4.3 |
| CS-12-D-03 | Form hypotheses and perform hypothesis testing; p-values; communicate findings with visuals | 4.4 |
Unit test
CS XII Unit 4 Test – Data and Analysis – 12 MCQs online (15 min). Full paper:
| Section | Questions | Marks |
|---|---|---|
| A – MCQs (online here) | 12 × 1 | 12 |
| B – Short questions | 4 × 3 | 12 |
| C – Long questions | 1 × 6 | 6 |
| Total | 30 |
Then take CS XII Monthly Test 3.
Practise these before the test
Long questions
- A bank wants to use machine learning to predict whether a loan applicant will repay the loan. Explain how “learning from data” works and describe the stages of building this model, including feature engineering, train-test split and model assessment. Also explain why the model’s predictions should not be treated as causes. (2 + 3 + 1)
- A hospital builds a model to detect diabetes. On 500 test patients: 80 diabetic patients were correctly detected, 20 diabetic patients were missed, 40 healthy patients were wrongly flagged and 360 healthy patients were correctly cleared. (a) Draw the confusion matrix. (b) Calculate accuracy, precision, recall and F1. (c) Which metric matters most here and how could the model be improved? (1 + 3 + 2)
- Your college wants to know whether attendance affects final marks. Explain how you would create a data story: formulate the question, identify the dataset, use descriptive statistics to build multiple views, choose and justify visualisations, and present the conclusion. (6)
- A researcher is studying the effect of a new study technique on student performance. (a) In the above context define the null and alternative hypotheses. (b) Explain the role of p-values in hypothesis testing. (c) Communicate your findings using data visuals. (2 + 2 + 2)
- An online shop uses machine learning to predict which customers will stop buying (churn). (a) Describe the features you would engineer and how you would split the data. (b) The model gives TP = 40, FN = 20, FP = 10, TN = 130. Calculate accuracy, precision and recall and say which metric matters most. (c) How could the shop use visuals to present the results to managers? (2 + 2 + 2)
Short questions
- What is the purpose of the train-test split in machine-learning model building?
- What is feature engineering, and why is it important in machine learning? (1 + 2)
- Differentiate between machine learning and rule-based algorithms with one example each.
- What are the key steps involved in building a machine-learning model?
- Explain the difference between prediction and causation with an example.
- Classify each problem as regression, classification or clustering: (a) predict house prices, (b) detect fraudulent transactions, (c) group news articles by topic without labels.
- Calculate accuracy, precision and recall for a model with TP = 90, FN = 10, FP = 30 and TN = 70.
- Explain overfitting and underfitting. How can each be detected?
Model answers are listed under each lesson of this unit (and below for the extra review questions).
Short and long questions
1. A hypothesis test gives p = 0.07 at α = 0.05. A student writes “the null hypothesis is proven true”. Correct this statement.
Model answer
Since p = 0.07 > 0.05 we fail to reject H₀ – the data do not give strong enough evidence against it. This does not prove H₀; the effect may exist but the sample could be too small. Correct statement: “At the 5% level there is not enough evidence to conclude an effect.”
2. An online shop uses machine learning to predict which customers will stop buying (churn). (a) Describe the features you would engineer and how you would split the data. (b) The model gives TP = 40, FN = 20, FP = 10, TN = 130. Calculate accuracy, precision and recall and say which metric matters most. (c) How could the shop use visuals to present the results to managers? (2 + 2 + 2)
Model answer
(a) Features and split (2): days since last order, number of orders in 6 months, average spend, complaints, app logins per week, delivery delays, discount use; encode city/category; scale amounts; label = churned yes/no. Split 80% training / 20% test (random, keeping class proportions), tune on validation data.
(b) Metrics (2): total = 200. Accuracy = (40 + 130)/200 = 85%; Precision = 40/(40 + 10) = 80%; Recall = 40/(40 + 20) = 66.7%. Recall matters most – missing customers who will leave means losing them without offering help; a few false alarms (FP) only cost a discount voucher.
(c) Visuals (2): a bar chart of churn rate by customer segment; a feature-importance bar chart (e.g. “days since last order” has most impact); a confusion-matrix heat map; a line chart of predicted churn over months – each with a message title and a short recommendation.
This lesson ends with a quiz of 16 MCQs. Open the lesson on PrepOasis to take it and save your progress.
Previous: 4.4 Hypothesis Testing: Null and Alternative Hypotheses, P-values and Conclusions · Next: 5.1 IoT, Cloud Computing and Blockchain: Designing Applications for Pakistan
All lessons in Computer Science XII (HSSC-II) – FBISE Complete SLO-Based Course