Learning Objectives

By the end of this lesson, learners should be able to:

  1. Explain the importance of machine learning model evaluation.
  2. Distinguish training, validation and test performance.
  3. Explain common classification evaluation metrics.
  4. Explain common regression evaluation metrics.
  5. Interpret confusion matrices.
  6. Explain precision, recall and F1-score.
  7. Explain model interpretability.
  8. Connect model performance with business costs and benefits.
  9. Identify risks associated with deploying machine learning models.
  10. Evaluate machine learning applications from a business perspective.

1. Introduction

Developing a machine learning model is not the final objective.

A model must answer three fundamental questions:

  1. Does it work technically?
  2. Can its outputs be trusted and interpreted appropriately?
  3. Does it create measurable business value?

A model can have excellent statistical performance but provide little business value if:

  • Its predictions arrive too late.
  • The organization cannot act on them.
  • Its operating cost is excessive.
  • Its outputs are difficult to explain.
  • The data changes after deployment.

2. Model Evaluation

Model evaluation measures how well a machine learning system performs.

Evaluation should be based on data that provides a credible estimate of performance on new observations.

The evaluation approach depends on the task.

Classification

Common metrics include:

  • Accuracy.
  • Precision.
  • Recall.
  • F1-score.
  • ROC-AUC.

Regression

Common metrics include:

  • MAE.
  • MSE.
  • RMSE.
  • R².

3. Training Performance

Training performance measures how well the model performs on data used during model development.

High training performance alone does not guarantee a good model.

A model may memorize training-specific patterns.

Therefore:

Training performance must not be treated as proof of generalization.

4. Validation Performance

Validation performance helps analysts:

  • Compare models.
  • Tune hyperparameters.
  • Select modelling approaches.

It is part of the development process.

5. Test Performance

A final test dataset can provide an estimate of how the selected model performs on unseen observations.

Ideally, the test dataset should remain separate from repeated model tuning.

6. Confusion Matrix

For binary classification, predictions can be organized into four categories:

 

Actual Positive

Actual Negative

Predicted Positive

True Positive

False Positive

Predicted Negative

False Negative

True Negative

These four outcomes form the foundation for several classification metrics.

7. True Positive

A true positive occurs when:

The model predicts positive and the actual outcome is positive.

Example:

A fraud model identifies a transaction as fraudulent and investigation confirms that it was fraudulent.

8. False Positive

A false positive occurs when:

The model predicts positive but the actual outcome is negative.

Example:

A legitimate transaction is incorrectly flagged as fraudulent.

False positives can create:

  • Customer inconvenience.
  • Investigation costs.
  • Lost sales.
  • Customer dissatisfaction.

9. False Negative

A false negative occurs when:

The model predicts negative but the actual outcome is positive.

Example:

A fraudulent transaction is classified as legitimate.

Depending on the business context, false negatives can be extremely costly.

10. Accuracy

Accuracy measures the proportion of correct predictions among all predictions.

It can be useful when classes are reasonably balanced and the costs of errors are relatively similar.

However, accuracy can be misleading when classes are highly imbalanced.

11. Precision

Precision asks:

Of the observations predicted as positive, how many were actually positive?

High precision means that positive predictions are relatively reliable.

This can be important when false positives are expensive.

12. Recall

Recall asks:

Of all actual positive cases, how many did the model correctly identify?

High recall means that the model captures a large proportion of positive cases.

Recall can be especially important when false negatives are costly.

13. Precision-Recall Trade-Off

Increasing the classification threshold may:

  • Reduce false positives.
  • Increase precision.
  • Potentially reduce recall.

Lowering the threshold may:

  • Capture more positive cases.
  • Increase recall.
  • Potentially increase false positives.

The appropriate balance depends on business costs.

14. F1-Score

The F1-score combines precision and recall into a single measure based on their harmonic mean.

It can be useful when both precision and recall are important.

However, analysts should not select metrics mechanically. Business consequences must be considered.

15. ROC-AUC

ROC-AUC is commonly used to evaluate the ability of a binary classifier to distinguish between classes across different classification thresholds.

It can be useful for comparing ranking performance.

However, it should be interpreted alongside business-relevant metrics.

16. Regression Evaluation

Regression models require different metrics.

MAE

Measures average absolute prediction error.

MSE

Measures average squared prediction error.

RMSE

Takes the square root of MSE and expresses error in the same units as the target.

Provides an indication of the proportion of variation explained by the model under the relevant modelling assumptions.

17. Business Meaning of Error

Suppose a sales forecasting model has an RMSE of:

KSh 100,000.

Management must ask:

Is an average error of this magnitude acceptable for the decision being supported?

A metric cannot be evaluated independently of business context.

18. Cost-Sensitive Evaluation

Not all errors have equal consequences.

Consider fraud detection.

A false positive may inconvenience a customer.

A false negative may allow substantial fraud.

The organization should therefore consider the relative cost of different errors.

19. Example: Medical Screening

In a high-risk screening context, missing a genuine positive case may be much more serious than conducting an additional investigation of a false positive.

This illustrates why recall may be prioritized in some applications.

The exact priorities depend on the domain, legal requirements and decision consequences.

20. Model Calibration

A model that predicts probabilities should ideally produce probabilities that are reasonably aligned with observed frequencies.

For example:

If among cases assigned a predicted risk of approximately 20%, about 20% actually experience the outcome over the relevant population and period, the predictions are better calibrated.

Calibration can matter in:

  • Credit risk.
  • Insurance.
  • Marketing.
  • Resource planning.

21. Model Interpretability

Interpretability concerns how easily humans can understand why a model produces particular outputs.

This can be important for:

  • Management.
  • Customers.
  • Regulators.
  • Auditors.
  • Risk teams.

Interpretability requirements vary by application.

22. Explainability Versus Performance

A highly complex model may sometimes achieve stronger predictive performance than a simple model.

However, an organization may prefer a simpler model when:

  • Decisions require explanation.
  • Regulations require transparency.
  • Stakeholders need confidence.
  • Operational teams need to understand model behavior.

Model selection is therefore a multidimensional decision.

23. Feature Importance

Feature importance can help analysts understand which variables contribute strongly to predictions.

However:

Feature importance does not automatically establish causality.

For example, a model may find that customer complaints are strongly associated with churn.

This does not by itself prove that complaints cause churn.

24. Explainable AI Techniques

Depending on the model, analysts can use techniques designed to help explain predictions.

These may provide:

  • Global explanations.
  • Local explanations.
  • Feature contribution estimates.
  • Decision pathways.

The method should be appropriate to the model and decision context.

25. Data Drift

After deployment, the statistical characteristics of incoming data may change.

This is sometimes called data drift.

For example:

A customer churn model trained before a major economic change may encounter customer behavior that differs significantly from its training data.

The model may therefore require reassessment.

26. Concept Drift

The relationship between inputs and the target can also change.

For example:

A fraud pattern that was predictive last year may become less useful after criminals change their behavior.

This is often described as concept drift.

27. Model Drift

Model performance can decline over time because:

  • Customer behavior changes.
  • Market conditions change.
  • Regulations change.
  • Products change.
  • Competitors change.
  • Fraud techniques evolve.

Organizations should monitor performance continuously where appropriate.

28. Model Monitoring

Monitoring may include:

  • Prediction accuracy.
  • Error rates.
  • Data distributions.
  • Missing values.
  • Input changes.
  • Output distributions.
  • Business KPIs.

Monitoring should be linked to predefined thresholds and escalation procedures.

29. Deployment

Deployment means making the model available for actual business use.

Deployment may occur through:

  • Business applications.
  • APIs.
  • Data pipelines.
  • Decision-support systems.
  • Dashboards.
  • Automated workflows.

Technical deployment is not sufficient by itself.

Users must understand how to use and interpret the model’s outputs.

30. Human Oversight

Some decisions should not be treated as purely automated.

Human oversight may be appropriate when:

  • Decisions have significant consequences.
  • Model confidence is low.
  • Exceptions occur.
  • Regulatory requirements apply.
  • Context not captured by the data matters.

The model can provide decision support rather than replacing professional judgment.

31. Machine Learning Governance

Organizations should establish governance around:

  • Model ownership.
  • Data sources.
  • Model versions.
  • Validation.
  • Documentation.
  • Access.
  • Monitoring.
  • Risk management.
  • Retirement.

Good governance improves accountability.

32. Documentation

A machine learning model should have sufficient documentation to explain:

  • Purpose.
  • Data sources.
  • Features.
  • Training period.
  • Target definition.
  • Modelling approach.
  • Evaluation results.
  • Limitations.
  • Deployment conditions.
  • Monitoring procedures.

Documentation supports continuity and accountability.

33. Privacy

Machine learning may involve large amounts of personal or commercially sensitive data.

Organizations should therefore consider:

  • Data minimization.
  • Access control.
  • Appropriate data use.
  • Security.
  • Retention.
  • Applicable data protection requirements.

Analytics capability should not override responsible data management.

34. Fairness

Models used in high-impact decisions should be evaluated for potentially unfair outcomes.

Potential concerns may arise from:

  • Biased historical data.
  • Unrepresentative samples.
  • Proxy variables.
  • Unequal error rates.

Fairness assessment should be appropriate to the specific application.

35. Business Value

A model should ultimately contribute to a measurable business outcome.

Examples include:

Revenue

  • Increased conversion.
  • Improved cross-selling.
  • Better customer retention.

Cost Reduction

  • Lower fraud losses.
  • Reduced operational waste.
  • Better resource allocation.

Risk Management

  • Improved credit decisions.
  • Earlier detection of financial problems.

36. Return on Analytics Investment

Management should compare:

Benefits

against

Costs

Costs can include:

  • Data preparation.
  • Infrastructure.
  • Software.
  • Staff.
  • Monitoring.
  • Maintenance.
  • Governance.

A technically impressive model may not be economically justified.

37. Example: Churn Model

Suppose a telecommunications company develops a churn model.

The model identifies:

10,000 customers as high risk.

The business then offers targeted retention incentives.

Management should measure:

  • Number of customers retained.
  • Cost of incentives.
  • Incremental revenue.
  • Customer lifetime value.
  • False positives.
  • False negatives.

The success of the project is not simply the model’s accuracy.

38. Example: Fraud Detection

A fraud model may identify suspicious transactions.

Business evaluation should consider:

  • Fraud losses prevented.
  • False-positive investigations.
  • Customer friction.
  • Processing time.
  • Operational costs.

A model that catches more fraud but blocks too many legitimate customers may create unintended business damage.

39. Example: Demand Forecasting

A retailer deploys a machine learning model to forecast product demand.

Potential benefits include:

  • Reduced stockouts.
  • Reduced excess inventory.
  • Improved cash utilization.
  • Better purchasing decisions.

The organization should compare these benefits with the cost of developing and maintaining the model.

40. Machine Learning Decision Framework

Before implementing a model, management should ask:

  1. What business decision will the model improve?
  2. What data is available?
  3. What target is being predicted?
  4. How will success be measured?
  5. What errors are most costly?
  6. How will predictions be interpreted?
  7. What governance is required?
  8. How will the model be monitored?
  9. What will happen when the model is wrong?
  10. Does the expected benefit justify the cost?

41. From Model to Business Value

The complete process can be viewed as:

Business Problem

Data

Model

Evaluation

Interpretation

Business Decision

Action

Outcome

Measurement and Improvement

This reinforces an important principle:

Machine learning is valuable when it improves decisions and outcomes, not merely when it produces predictions.

42. Best Practices

Business analysts should:

  1. Use evaluation metrics appropriate to the problem.
  2. Avoid relying solely on accuracy.
  3. Separate development and test data appropriately.
  4. Consider the costs of different errors.
  5. Assess interpretability requirements.
  6. Monitor data and model performance.
  7. Document assumptions and limitations.
  8. Consider privacy and fairness.
  9. Connect model outputs to business KPIs.
  10. Continuously evaluate whether the model remains valuable.

Lesson Summary

Machine learning evaluation requires more than measuring predictive accuracy.

Classification models may be evaluated using:

  • Accuracy.
  • Precision.
  • Recall.
  • F1-score.
  • ROC-AUC.

Regression models may be evaluated using:

  • MAE.
  • MSE.
  • RMSE.
  • R².

Effective business application also requires:

  • Interpretability.
  • Governance.
  • Privacy.
  • Fairness.
  • Monitoring.
  • Cost-benefit analysis.
  • Human oversight where appropriate.

A machine learning model should therefore be viewed as part of a broader business decision system