CHAPTER PDF
Complete curriculum textbook chapter document for reading and offline study.
NOTES
Complete conceptual breakdown, formulas, diagrams, and memory aids.
Evaluating Models
Complete student-friendly notes, formulas, solved activities, textbook questions and board-oriented practice.
Prepared from the complete uploaded 25-page Chapter3.pdf, including page diagrams and tables.
Unit overview
This unit explains how to measure AI model performance and decide whether a model is reliable and suitable for real-world use.
- Understand common evaluation metrics.
- Derive and calculate metrics.
- Choose a suitable metric for an application.
- Recognise evaluation metrics.
- Calculate evaluation metrics.
- Select a metric for real-life use cases.
Prerequisite: Essential understanding of AI. Key concepts: Importance of model evaluation and classification metrics.
Introduction
The four earlier AI project-cycle stages are Problem Scoping, Data Acquisition, Data Exploration and Modelling. Evaluation compares models and estimates how well a selected model will work on future unseen data.
3.1 Importance of Model Evaluation
- An AI model can improve through constructive feedback.
- Build, measure, improve and repeat until desirable performance is achieved.
- Evaluation reveals strengths, weaknesses and suitability.
School report-card analogy
Grades, percentages, percentiles and ranks show a student's performance. Similarly, evaluation metrics show where an AI model performs well and where it needs improvement.
3.2 Splitting the Training Set Data for Evaluation
- It can be used for supervised-learning algorithms.
- Training data teaches the model; testing data evaluates it.
- It is appropriate when a sufficiently large dataset is available.
Textbook diagram: 10,000 labelled images
Why split data?
- Train the model on the training subset.
- Give test inputs to the trained model.
- Obtain predictions.
- Compare predictions with expected values.
- Estimate performance on data not used in training.
The PDF notes that train-test split and cross-validation are studied in more detail in higher classes.
3.3 Accuracy and Error
Concert-fee example
Bob brings ₹300 and Billy ₹550; the actual entry fee is ₹500.
| Person | Estimate | Actual | Absolute error |
|---|---|---|---|
| Bob | ₹300 | ₹500 | |500−300| = ₹200 |
| Billy | ₹550 | ₹500 | |500−550| = ₹50 |
Billy is more accurate because his estimate is closer to the actual fee.
In disease prediction, predicting “no disease” when the person actually has the disease is an error. If every prediction in the evaluated set is correct, accuracy is 100%.
Activity 1 – Accuracy of the House-Price Model
Purpose: Calculate error and accuracy for five predicted house prices. Model accuracy is the mean of the five sample accuracies.
Abs means absolute value: use the magnitude without a negative sign.
| Predicted | Actual | Abs. error | Error rate | Accuracy | % |
|---|---|---|---|---|---|
| $391k | $402k | $11k | .02736 | .97264 | 97.26% |
| $453k | $488k | $35k | .07172 | .92828 | 92.83% |
| $125k | $97k | $28k | .28866 | .71134 | 71.13% |
| $871k | $907k | $36k | .03969 | .96031 | 96.03% |
| $322k | $425k | $103k | .24235 | .75765 | 75.76% |
The PDF rounds sample 1 to 97.3%; extra decimals are retained here for a reproducible mean.
3.4 Evaluation Metrics for Classification
Supermarket example: separate fruits and vegetables from grocery items such as bread, oil and eggs. A classifier predicts the item's category.
Textbook “Try Yourself”
Choices: house-price prediction, credit-card fraud detection, salary prediction.
Classification metrics
- Confusion matrix
- Classification accuracy
- Precision
- Recall
- F1 score
Confusion Matrix
In the medical example, output 1 means infected and 0 means not infected. Actual values are rows/y-axis; predicted values are columns/x-axis.
| Actual \ Predicted | Positive (1) | Negative (0) |
|---|---|---|
| Positive (1) | TP | FN |
| Negative (0) | FP | TN |
The source matrix on pages 8–9 shows TP=12, FN=6, FP=4 and TN=21. Green cells are correct; red cells are incorrect.
Activity 2 – Build a Confusion Matrix from Scratch
Duration: 10 minutes. Yes means disease present; No means disease absent. The ten rows from PDF page 10:
| Row | Actual | Predicted | Outcome |
|---|---|---|---|
| 1 | Yes | Yes | TP |
| 2 | No | No | TN |
| 3 | No | Yes | FP |
| 4 | Yes | No | FN |
| 5 | No | No | TN |
| 6 | Yes | Yes | TP |
| 7 | Yes | No | FN |
| 8 | No | No | TN |
| 9 | No | No | TN |
| 10 | No | No | TN |
Counts: TP=2, FN=2, FP=1, TN=5.
| Actual \ Predicted | Yes | No | Total |
|---|---|---|---|
| Yes | TP=2 | FN=2 | 4 |
| No | FP=1 | TN=5 | 6 |
| Total | 3 | 7 | 10 |
TP, TN, FP and FN
Classification Accuracy from a Confusion Matrix
Given TP=12, FN=6, FP=4 and TN=21:
Accuracy cannot always be used alone. It may mislead on imbalanced data or when false positives and false negatives have different costs.
Activity 3 – Accuracy on an Unbalanced Dataset
There are 1,000 test records: 900 actual Yes/pass and 100 actual No/not pass. The faulty model predicts Yes for every input.
| Actual | Predicted |
|---|---|
| Yes=900 | Yes=1,000 |
| No=100 | No=0 |
| Actual \ Predicted | Yes | No |
|---|---|---|
| Yes | TP=900 | FN=0 |
| No | FP=100 | TN=0 |
The model scores 90% but never correctly predicts the No class. This proves that accuracy alone can be misleading for unbalanced data.
Precision
Precision .843 means that when the model predicts heart disease, it is correct about 84.3% of the time.
Use precision when false positives are costly and must be reduced. It answers: of all predicted positives, how many are actually positive?
Textbook example: satellite launch weather
Favourable weather is positive. Missing a good day may be acceptable, but calling unsafe weather favourable could be disastrous. Reduce false positives; therefore precision matters.
Recall
Recall .86 means 86% of all patients who actually have heart disease are correctly identified.
Use recall when false negatives are costly. It answers: of all actual positives, how many did the model find?
Textbook example: COVID-19 detection
If an infected person is predicted as not infected, they may miss treatment and infect others. False negatives must be reduced, so recall is the appropriate metric.
F1 Score
Use F1 on unbalanced data when neither false positives nor false negatives can be ignored and a balance is required.
| Metric | Formula | Focus |
|---|---|---|
| Accuracy | (TP+TN)/Total | Overall correctness |
| Precision | TP/(TP+FP) | Reduce FP |
| Recall | TP/(TP+FN) | Reduce FN |
| F1 | 2PR/(P+R) | Balance P and R |
Activity 4 – Fraud Detection
Duration: 30 minutes. In the textbook case, a legitimate transaction wrongly flagged can be rechecked, but a fraudulent transaction classified as legitimate may go unnoticed. Reduce false negatives; therefore Recall is the appropriate metric.
| ID | Actual | Predicted |
|---|---|---|
| 1 | Non-fraud | Non-fraud |
| 2 | Non-fraud | Fraud |
| 3 | Non-fraud | Non-fraud |
| 4 | Fraud | Non-fraud |
| 5 | Fraud | Fraud |
| 6 | Non-fraud | Non-fraud |
| 7 | Fraud | Non-fraud |
| 8 | Non-fraud | Fraud |
| 9 | Non-fraud | Non-fraud |
| 10 | Non-fraud | Non-fraud |
Counts: TP=1, FN=2, FP=2, TN=5.
| Actual \ Predicted | Fraud | Non-fraud |
|---|---|---|
| Fraud | TP=1 | FN=2 |
| Non-fraud | FP=2 | TN=5 |
Ethical Concerns Around Model Evaluation
The diagram on PDF page 21 lists three concerns:
Chosen metrics should not produce or hide bias. Evaluation data should fairly represent affected people and situations.
Explain honestly how metrics work and how results are produced. Do not hide the methodology.
Take responsibility for metric selection and evaluation methodology, especially where AI affects people or society.
Textbook Test Yourself – 10 MCQs with Solutions
1. Medical test: 1,000 people; 50 diseased, 950 healthy; TP=40 and 30 healthy people wrongly positive. Find accuracy.
- 97%
- 90%
- 85%
- 70%
2. A student answers 90 of 100 questions correctly. Find error rate.
- 10%
- 9%
- 8%
- 11%
3. Out of 1,000 emails, TP=240 spam and FP=60 legitimate emails marked spam. Find precision.
- 80%
- 70%
- 75%
- 90%
4. A model predicts 70 instances positive, of which 50 are actually positive. Find recall.
- 50%
- 70%
- 80%
- 100%
5. 120 positive sentiments correctly predicted out of 200 actual positives; 40 negatives wrongly predicted positive. Find F1.
- 0.8
- 0.75
- 0.72
- 0.82
6. 1,000 people; 100 diseased, TP=90 and FP=50. Find precision.
- 90%
- 80%
- 70%
- 60%
7. Predicted marks 75; actual marks 80. Absolute error?
- 5
- 10
- 15
- 20
8. Goal of evaluating an AI model?
- Maximise error
- Minimise error and maximise accuracy
- Only count data points
- Prioritise complexity
9. A high F1 score generally suggests?
- Imbalance between P and R
- Good balance between P and R
- Only selected points
- More training data
10. Relationship between performance and accuracy?
- Inverse
- Not related
- Direct
- Random
Reflection Time – Model Answers
Q1. What happens if a model is deployed without evaluation on known test data?
Q2. Is evaluation essential in the AI project cycle?
Q3. Explain train-test split with an example.
Q4. Justify why both error and accuracy are important.
Q5. What is classification accuracy? Can it always be used?
Assertion and Reasoning
Options: (a) Both true and R explains A; (b) Both true but R does not explain A; (c) A true, R false; (d) A false, R true.
Q1. A: Accuracy measures the number of predictions a model gets right. R: Better model performance generally produces more accurate predictions.
Q2. A: Sum of a confusion-matrix row represents total instances for an actual class. R: This enables calculation of class-specific metrics such as precision and recall.
Case Study-Based Questions – Solved
Q1. Choose Precision or Recall
Email spam detection
Cancer diagnosis
Legal cases – innocent until proven guilty
Fraud detection
Safe content filtering for children
Q2. Calculate accuracy, precision, recall and F1
Formulas: Accuracy=(TP+TN)/Total; Precision=TP/(TP+FP); Recall=TP/(TP+FN); F1=2PR/(P+R).
Case 1 – Spam detection
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | TP=150 | FN=50 |
| Negative | FP=50 | TN=750 |
Case 2 – Credit default
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | TP=90 | FN=50 |
| Negative | FP=40 | TN=820 |
Case 3 – Fraud detection
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | TP=80 | FN=40 |
| Negative | FP=30 | TN=850 |
Case 4 – Medical diagnosis
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | TP=120 | FN=60 |
| Negative | FP=20 | TN=800 |
Case 5 – Inventory stockout
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | TP=100 | FN=50 |
| Negative | FP=50 | TN=800 |
Chapter Summary and Revision Sheet
Important definitions
- Model evaluation: Measuring model performance using metrics.
- Train-test split: Dividing data into training and testing subsets.
- Overfitting: Memorising training examples and failing to generalise.
- Accuracy: Correct predictions divided by total predictions.
- Error: Difference between prediction and actual outcome.
- Classification: Predicting a category.
- Confusion matrix: Comparing actual and predicted classes.
- TP: Actual positive predicted positive.
- TN: Actual negative predicted negative.
- FP: Actual negative predicted positive.
- FN: Actual positive predicted negative.
- Precision: Correct positives among predicted positives.
- Recall: Correct positives among actual positives.
- F1: Harmonic mean of precision and recall.
Formula sheet
| Metric | Formula | Purpose |
|---|---|---|
| Absolute error | |Actual−Predicted| | Numerical prediction difference |
| Error rate | Absolute error/Actual | Relative error in house-price activity |
| Accuracy | (TP+TN)/Total | Overall correctness |
| Precision | TP/(TP+FP) | Reduce false positives |
| Recall | TP/(TP+FN) | Reduce false negatives |
| F1 | 2PR/(P+R) | Balance precision and recall |
Metric selection
False positive costly: satellite launch safety.
False negative costly: disease or fraud.
Both error types matter.
Overall correctness is meaningful and classes/errors are suitably balanced.
Diagrams to practise
- AI project cycle including Evaluation (page 2).
- Train-test split with 8,000/2,000 images (page 3).
- Confusion matrix with actual rows and predicted columns (pages 8–9).
- TP, TN, FP and FN (pages 12–14).
- Unbalanced example TP=900, FP=100, FN=0, TN=0 (pages 15–16).
- Bias, Transparency and Accountability (page 21).
PDF Coverage and Verification
The uploaded Chapter3.pdf contains 25 pages. Page text and embedded diagrams/tables were reviewed. This coverage map follows the source sequence.
| Pages | Content covered |
|---|---|
| 1 | Unit title, summary, objectives, outcomes, prerequisites and key concepts. |
| 2–3 | Introduction, AI cycle, importance, report-card analogy, train-test split and 8,000/2,000 visual. |
| 4–5 | Need for split, overfitting, concert example, accuracy/error definitions and disease example. |
| 6 | All five house-price samples and accuracy calculations. |
| 7–9 | Classification, supermarket example, use-case question, metrics and confusion matrix visuals. |
| 10–11 | Activity 2, all ten Yes/No records, matrix construction and reflection. |
| 12–13 | TP, TN, FP, FN definitions and examples. |
| 14–16 | Accuracy formula, matrix calculation, accuracy limitations and imbalanced-data activity. |
| 17–19 | Precision, satellite example, recall, sensitivity/TPR, COVID example, F1 and fraud activity. |
| 20–21 | Fraud transaction table, recall calculation and ethical-concerns diagram. |
| 21–23 | Ten MCQs and five Reflection Time questions. |
| 23–24 | Two assertion–reason questions and metric-selection case study. |
| 24–25 | Five case studies and metric calculations. |
Source inconsistencies corrected transparently
- MCQ 1 calculates to 96%, but no option matches.
- MCQ 4 does not give FN or total actual positives; recall cannot be calculated.
- MCQ 5 calculates to F1=.6667, not present in the options.
- MCQ 6 calculates to 64.29%; 60% is only the closest printed option.
- Page 18 says “Precision” at the end of a false-negative discussion; the correct metric is Recall.
- Case Study 5 repeats TN; its intended value is counted once.
Source diagrams are recreated as responsive HTML diagrams and tables rather than fixed screenshots for mobile readability and print quality.
TEXTBOOK SOLUTION
Step-by-step solved textbook exercises, derivations, and solutions.
Unit 3: Evaluating Models
Complete textbook back-exercise solutions · MCQs · Reflection Time · Assertion–Reason · Case Studies
How to use these solutions
Prepared from the uploaded textbook, Unit 3: Evaluating Models, pages 21–25. Answers use simple English suitable for Class 10 students. Numerical questions include formulas, substitutions, calculations and final answers.
1. Test Yourself — Multiple-Choice Questions (Pages 21–23)
TP = 40. Diseased people missed: FN = 50 − 40 = 10. FP = 30. Healthy people correctly identified: TN = 950 − 30 = 920.
= (40 + 920) / (40 + 920 + 30 + 10)
= 960 / 1000 = 0.96 = 96%
Incorrect answers = 100 − 90 = 10.
= (10 / 100) × 100 = 10%
TP = 240; FP = 60.
= 240 / (240 + 60) = 240/300 = 0.8 = 80%
Given: TP = 50 and predicted positives TP + FP = 70.
50/70 = 71.43% is precision, not recall. If the textbook intended precision, option B (70%) is the approximate choice. As printed, recall cannot be determined.
TP = 120; FN = 200 − 120 = 80; FP = 40.
Recall = TP/(TP+FN) = 120/200 = 0.60
F1 = 2 × Precision × Recall / (Precision + Recall)
= 2 × 0.75 × 0.60 / 1.35
= 0.90 / 1.35 = 0.6667 ≈ 0.67
TP = 90; FP = 50.
= 90/(90+50) = 90/140 = 0.642857
= 64.29% (approximately)
= |80 − 75| = 5
A good model should make more correct predictions and fewer mistakes. The best metric still depends on the task.
F1 score is the harmonic mean of precision and recall. A high F1 score generally means both are reasonably high.
In general, more correct predictions mean higher accuracy and better performance on the evaluated data. Accuracy alone, however, may not be enough for imbalanced datasets.
2. Reflection Time — Descriptive Answers (Page 23)
If an AI model is deployed without evaluation on a separate test dataset, we may not know how well it will perform on new, unseen data. It may appear successful on training examples but produce incorrect predictions in real-world situations.
- Unreliable predictions: The model may make mistakes when it receives new data.
- Overfitting: It may have memorised training examples instead of learning general patterns, so it performs poorly on unseen data.
- Wrong decisions: In healthcare, banking or education, incorrect predictions may lead to harmful decisions.
- Unknown weaknesses: Without evaluation metrics, developers may not understand the types of mistakes the model makes.
- Loss of trust: Users may lose confidence in an AI system that gives inconsistent results.
Conclusion: A model should be tested before deployment. Evaluation estimates its ability to handle unseen examples and helps developers improve its reliability.
Yes. Evaluating an AI model is an essential stage of the AI project cycle because it measures how accurately and reliably the model performs its task. Building or training a model does not guarantee correct real-world results.
- Measures performance: Accuracy, precision, recall and F1 score show how well the model performs.
- Identifies errors: Evaluation reveals incorrect predictions and weaknesses.
- Improves the model: Developers can study the results, make changes and train the model again.
- Compares models: It helps select the most suitable model from several alternatives.
- Tests unseen data: A separate test set estimates how the model may work on future examples.
- Builds trust: Proper evaluation supports reliable and responsible AI systems.
Conclusion: Evaluation gives feedback about a model's strengths and weaknesses and helps improve it before deployment.
Train-test split is a technique for evaluating a machine-learning algorithm. A dataset is divided into two subsets: a training dataset and a testing dataset.
Training dataset: Used to teach the model. The model studies examples and learns patterns or relationships between inputs and outputs.
Testing dataset: Kept separate during training. After training, its input data is given to the model. The predicted outputs are compared with the actual outputs to measure performance.
Example: Suppose we have 10,000 labelled images for identifying cats and dogs. We can divide them as follows:
| Dataset | Images | Purpose |
|---|---|---|
| Training set | 8,000 (80%) | Model learns patterns from cat and dog images. |
| Testing set | 2,000 (20%) | Checks how accurately the trained model identifies unseen images. |
First, the model learns from 8,000 images. Then, the 2,000 test images are supplied. Predicted labels are compared with actual labels and evaluation metrics are calculated.
Conclusion: Train-test split estimates how well a model performs on data it has not seen during training. It is suitable when a sufficiently large dataset is available.
Understanding both error and accuracy is important because they describe model performance from two viewpoints. Accuracy tells us how many predictions are correct, while error tells us about incorrect predictions or the difference between predicted and actual values.
Accuracy: It measures the number of correct predictions as a proportion of all predictions. Higher accuracy generally indicates better performance on the evaluated data.
Error: It refers to the difference between a model's prediction and the actual result. It helps us understand how often the model makes mistakes or how far its predictions are from actual values.
Importance of both:
- They help identify strengths and weaknesses.
- They show whether predictions are reliable.
- They help developers identify areas that need improvement.
- They help compare different models.
- They provide feedback for further training and fine-tuning.
Example: An AI model predicts results for 100 student records. If 90 predictions are correct and 10 are incorrect, its accuracy is 90% and its error rate is 10%. The developer can study the 10 incorrect predictions and improve the model.
Conclusion: Accuracy shows how well a model performs, while error highlights its mistakes. Both are needed for evaluation. For some tasks, precision and recall are also necessary.
Classification accuracy is the ratio of correct predictions made by a classification model to the total number of predictions. It is usually expressed as a percentage.
= (TP + TN) / (TP + TN + FP + FN)
Example: If a model makes 100 predictions and 80 are correct:
Can it be used all the time? No. Accuracy may be misleading when the dataset is highly unbalanced or when different mistakes have different consequences.
Example: A dataset has 1,000 transactions: 900 legitimate and 100 fraudulent. A faulty model predicts every transaction as legitimate. It correctly classifies 900 transactions and misses all 100 fraud cases. Its accuracy is 90%, even though it detects no fraud.
In such cases, other metrics are useful:
- Precision: When False Positives should be reduced.
- Recall: When False Negatives should be reduced.
- F1 Score: When a balance between precision and recall is needed.
Conclusion: Accuracy is useful when classes are reasonably balanced and errors have similar importance. It should not be used alone in every situation; the metric must suit the task.
3. Assertion and Reasoning-Based Questions (Pages 23–24)
Options: (a) Both true and R correctly explains A. (b) Both true but R does not correctly explain A. (c) A true, R false. (d) A false, R true.
Explanation: The Assertion is true because accuracy measures the proportion of correct predictions. The Reason is also generally true in the textbook context: better prediction performance is associated with higher accuracy. However, the Reason describes the relationship between accuracy and performance; it does not explain the definition of accuracy in the Assertion.
Options: (a) Both true and R correctly explains A. (b) Both true but R does not correctly explain A. (c) A true, R false. (d) A false, R true.
Explanation: The Assertion is true because actual values are placed in rows, so adding a row gives the total number of instances in that actual class. The Reason is also true: confusion-matrix values help calculate class-specific metrics. However, it describes a use of the row totals rather than explaining why the row sum represents the total actual instances. With this matrix layout, column totals represent predicted-class totals and are used for precision calculations.
4. Case Study-Based Questions (Pages 24–25)
(a) Email Spam Detection — Precision (when avoiding false spam flags is the priority). A legitimate email incorrectly marked as spam is a False Positive. Precision focuses on reducing False Positives. High precision means that emails labelled as spam are more likely to actually be spam. If catching every spam email is the main priority, recall also matters.
(b) Cancer Diagnosis — Recall. Missing a patient who actually has cancer is a False Negative. Recall measures the proportion of all actual positive cases correctly identified. High recall helps reduce missed cases and supports timely further medical examination.
(c) Legal Cases (Innocent until proven guilty) — Precision. If “guilty” is the positive class, an innocent person wrongly classified as guilty is a False Positive. Precision focuses on reducing False Positives. AI predictions must never replace proper evidence and due process.
(d) Fraud Detection — Recall. A fraudulent transaction incorrectly classified as legitimate is a False Negative. High recall helps detect as many actual fraud cases as possible. A legitimate transaction wrongly flagged can be reviewed separately.
(e) Safe Content Filtering (such as Kids YouTube) — Recall when the priority is not to miss unsafe content. If unsafe content is the positive class, unsafe material incorrectly allowed as safe is a False Negative. High recall helps reduce the chance of harmful content reaching children. Precision is also important because safe videos should not be wrongly blocked, so a practical system should balance both.
Q2. Draw the confusion matrix and calculate Accuracy, Precision, Recall and F1 Score for each case.
For every case, the positive class is the class marked as “1”. Actual values are rows; predicted values are columns.
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
F1 = 2 × Precision × Recall / (Precision + Recall)
Given TP=150, FP=50, TN=750, FN=50. Total=1000.
| Actual / Predicted | Spam (1) | Not Spam (0) |
|---|---|---|
| Spam (1) | TP=150 | FN=50 |
| Not Spam (0) | FP=50 | TN=750 |
Accuracy: (150+750)/1000 = 900/1000 = 90%.
Precision: 150/(150+50) = 150/200 = 75%.
Recall: 150/(150+50) = 150/200 = 75%.
F1: 2×0.75×0.75/(0.75+0.75) = 1.125/1.5 = 0.75 (75%).
Given TP=90, FP=40, TN=820, FN=50. Total=1000.
| Actual / Predicted | Default (1) | Not Default (0) |
|---|---|---|
| Default (1) | TP=90 | FN=50 |
| Not Default (0) | FP=40 | TN=820 |
Accuracy: (90+820)/1000 = 910/1000 = 91%.
Precision: 90/(90+40) = 90/130 = 69.23%.
Recall: 90/(90+50) = 90/140 = 64.29%.
F1: 2×0.6923×0.6429/(0.6923+0.6429) ≈ 0.6667 (66.67%).
Given TP=80, FP=30, TN=850, FN=40. Total=1000.
| Actual / Predicted | Fraud (1) | Legitimate (0) |
|---|---|---|
| Fraud (1) | TP=80 | FN=40 |
| Legitimate (0) | FP=30 | TN=850 |
Accuracy: (80+850)/1000 = 930/1000 = 93%.
Precision: 80/(80+30) = 80/110 = 72.73%.
Recall: 80/(80+40) = 80/120 = 66.67%.
F1: 2×0.7273×0.6667/(0.7273+0.6667) ≈ 0.6957 (69.57%).
Given TP=120, FP=20, TN=800, FN=60. Total=1000.
| Actual / Predicted | Disease (1) | No Disease (0) |
|---|---|---|
| Disease (1) | TP=120 | FN=60 |
| No Disease (0) | FP=20 | TN=800 |
Accuracy: (120+800)/1000 = 920/1000 = 92%.
Precision: 120/(120+20) = 120/140 = 85.71%.
Recall: 120/(120+60) = 120/180 = 66.67%.
F1: 2×0.8571×0.6667/(0.8571+0.6667) = 0.75 (75%).
Given TP=100, FP=50, TN=800, FN=50. Total=1000. The textbook repeats the TN statement; TN=800 is counted once.
| Actual / Predicted | Out of Stock (1) | Not Out of Stock (0) |
|---|---|---|
| Out of Stock (1) | TP=100 | FN=50 |
| Not Out of Stock (0) | FP=50 | TN=800 |
Accuracy: (100+800)/1000 = 900/1000 = 90%.
Precision: 100/(100+50) = 100/150 = 66.67%.
Recall: 100/(100+50) = 100/150 = 66.67%.
F1: 2×0.6667×0.6667/(0.6667+0.6667) = 0.6667 (66.67%).
Q2 — Final answer comparison
| Case | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|
| 1. Spam detection | 90% | 75% | 75% | 0.75 |
| 2. Credit scoring | 91% | 69.23% | 64.29% | 0.67 |
| 3. Fraud detection | 93% | 72.73% | 66.67% | 0.70 |
| 4. Medical diagnosis | 92% | 85.71% | 66.67% | 0.75 |
| 5. Inventory management | 90% | 66.67% | 66.67% | 0.67 |
5. Important Formula Sheet for Revision
| Metric | Formula | Meaning |
|---|---|---|
| Absolute Error | |Actual − Predicted| | Magnitude of difference between actual and predicted values. |
| Error Rate | Incorrect predictions / Total predictions | Fraction of predictions that are wrong. |
| Accuracy | (TP + TN) / (TP + TN + FP + FN) | Fraction of all predictions that are correct. |
| Precision | TP / (TP + FP) | Of predicted positives, how many are actually positive? |
| Recall | TP / (TP + FN) | Of actual positives, how many did the model identify? |
| F1 Score | 2 × Precision × Recall / (Precision + Recall) | Harmonic mean of precision and recall. |
Confusion matrix — four terms
| Actual / Predicted | Positive | Negative |
|---|---|---|
| Positive | True Positive (TP) Correct positive prediction | False Negative (FN) Actual positive missed |
| Negative | False Positive (FP) Actual negative wrongly marked positive | True Negative (TN) Correct negative prediction |
Which metric should be selected?
- Precision: When False Positives are costly and should be reduced.
- Recall: When False Negatives are costly and should be reduced.
- F1 Score: When a balance between precision and recall is needed.
- Accuracy: When classes are reasonably balanced and the two types of error have similar importance.
6. Ethical Concerns in Model Evaluation (Page 21)
The textbook highlights three ethical concerns:
- Bias: Ensure that the evaluation metrics and test data do not produce biased results against any group or individual.
- Transparency: Explain honestly how the selected metrics work and how the results are produced. Do not hide important information.
- Accountability: The people selecting the metrics and evaluation method must take responsibility for their choices and the effects of the system.
7. Textbook Coverage and Important Clarifications
This solution set covers the written exercise at the end of the uploaded PDF:
- Pages 21–23: all 10 Test Yourself MCQs.
- Page 23: all 5 Reflection Time questions.
- Pages 23–24: both Assertion–Reason questions.
- Pages 24–25: Case Study Q1 (five scenarios) and Case Study Q2 (five numerical cases).
Source-based clarifications:
- MCQ 1: the supplied values give 96% accuracy, but none of the options matches.
- MCQ 4: the question gives predicted positives and true positives, enough for precision but not recall. The actual-positive total is missing.
- MCQ 5: the supplied data give F1 ≈ 0.67, not one of the options.
- MCQ 6: the supplied data give precision ≈ 64.3%, not an exact listed option.
- Case Study 5: the textbook repeats the TN line. TN=800 is counted once.
Where the source contains missing information or inconsistent options, the solutions preserve the supplied data and identify the issue instead of silently changing the question.
IMPORTANT QUESTION
High-yield board questions, previous year questions (PYQs), and model answer keys.
Important Questions Being Compiled
Board blueprint and previous years' exam questions for this chapter will be live soon.