Business Analytics & Forecasting

Chapter 10
Predictive Analytics and Machine Learning

Post Graduate Program in Operations Management
Business Analytics & Forecasting   •   Post Graduate

Predictive Analytics and Machine Learning

Introduction

Predictive analytics uses historical and current data to estimate future outcomes, classify cases, detect unusual behaviour, or discover meaningful groups. In operations management, its value is not prediction alone. The managerial objective is to improve decisions about inventory, capacity, quality, maintenance, customer retention, sourcing and risk. A technically accurate model can still be operationally useless if its predictions arrive too late, cannot be explained, or do not change an available decision.

Machine learning (ML) provides a family of computational methods that learn relationships from data. Supervised learning uses an outcome variable known during model development; unsupervised learning searches for structure without a labelled outcome. The distinction is practical: predicting whether an order will be late is supervised classification, while grouping customers by purchasing behaviour is unsupervised clustering.

Learning Objectives

After studying this chapter, the reader should be able to:

  1. Distinguish classification, regression, clustering, anomaly detection and ensemble learning.
  2. Design features and data partitions that avoid leakage and support valid operational decisions.
  3. Select and evaluate models using metrics appropriate to the business loss.
  4. Diagnose overfitting, bias, variance and temporal drift.
  5. Apply predictive methods to demand, quality, maintenance, churn and supply risk.
  6. Explain, govern and monitor ML systems responsibly.

1. The Predictive Analytics Workflow

A robust workflow is iterative rather than a one-time modelling exercise:

Business decision → data definition → feature engineering → train/validation/test design → model fitting → evaluation → explanation → deployment → monitoring → learning.

The first step is to specify the decision. For example, “predict demand” is incomplete. The required question may be: “At 09:00 each Monday, estimate next week’s demand for each item-location pair so that replenishment quantities can be set.” This defines the forecast horizon, information availability, granularity and decision latency.

A dataset is commonly represented by observations i = 1, …, n, features xᵢ and target yᵢ. A fitted model produces ŷᵢ = f(xᵢ; θ), where θ denotes learned parameters. The model is useful only if its performance generalises from the development sample to future operational cases.

Data quality and governance

Important questions include:

  • Is the target measured consistently, or does it contain changed definitions?
  • Are timestamps accurate and in a common time zone?
  • Are cancellations, stock-outs and returns represented correctly?
  • Does a feature become known only after the prediction time?
  • Are observations independent, or do repeated records belong to the same customer, asset or supplier?
  • Does the sample represent the population on which the model will operate?

Data lineage, access control, retention rules and documented definitions are as important as algorithm selection. A model cannot correct systematic measurement error or biased sampling merely by being more sophisticated.

2. Feature Engineering and Representation

Feature engineering converts raw operational records into variables that express relevant mechanisms. Examples include rolling demand averages, supplier lead-time variability, machine temperature trends, order frequency, defect rates and time since last service.

For a time series yₜ, a rolling mean over the preceding k periods may be written as:

\bar{y}t,k = (1/k) ∑j=1k yt-j

Here, k is the window length and yₜ₋ⱼ is the value known before time t. The exclusion of yₜ is essential when the feature is intended for a prediction made at t. The formula assumes observations are measured at comparable intervals; missing periods require explicit treatment.

Common transformations include:

  • Categorical encoding: one-hot encoding for unordered categories; ordinal encoding only when order is meaningful.
  • Scaling: standardisation, x′ = (x − μ) / σ, where μ and σ are calculated from the training data only. This has no units after transformation and is especially useful for distance-based and regularised models.
  • Log transformation: log(1 + x) for non-negative, right-skewed variables, provided the interpretation of zero is considered.
  • Interaction features: products or conditional effects, such as promotion × store type.
  • Aggregations: customer-level or supplier-level counts, rates and recency measures.
  • Missingness indicators: a separate flag may preserve information when missingness itself reflects an operational process.

Feature selection should combine statistical evidence, process knowledge and availability at decision time. Removing redundant features can improve interpretability and reduce operational data requirements, but automatic selection must be conducted within the training procedure to prevent optimistic evaluation.

Leakage

Leakage occurs when information unavailable at prediction time enters the features or target construction. Examples include using final delivery status to predict lateness, using a post-failure repair code to predict failure, or calculating a customer’s annual spend using transactions that occurred after the churn decision. Leakage often produces excellent test results and poor deployment performance. Temporal cut-offs and point-in-time data construction are the primary safeguards.

3. Supervised Learning

3.1 Regression

Regression predicts a numerical outcome such as demand, repair duration, cost or lead time. Ordinary least squares regression models a conditional mean:

yᵢ = β₀ + β₁xᵢ₁ + ⋯ + βpxᵢp + εᵢ

where β₀ is the intercept, βⱼ are coefficients, xᵢⱼ are features and εᵢ is an error term. The usual least-squares estimate minimises:

SSE = ∑ᵢ (yᵢ − ŷᵢ)²

The model is most defensible when the conditional mean is approximately linear in the predictors, observations are appropriately structured, extreme outliers are understood, and the error assumptions are suitable for the intended inference. Prediction can remain useful when classical inferential assumptions are imperfect, but uncertainty and dependence must then be handled carefully.

Regularisation controls coefficient instability. Ridge regression minimises:

∑ᵢ (yᵢ − ŷᵢ)² + λ∑ⱼ βⱼ²

Lasso regression replaces the squared penalty with λ∑ⱼ|βⱼ| and may set some coefficients exactly to zero. λ ≥ 0 controls the penalty and must be selected using validation within the training period. Features should generally be scaled before penalisation so that units do not determine the penalty unfairly.

For demand with many zero values or asymmetric costs, alternatives include count models, quantile regression, tree-based methods and specialised intermittent-demand methods. The chosen loss should match the decision, not simply the algorithm’s default.

3.2 Classification

Classification predicts a category, such as defective/non-defective, churn/no churn or high-risk/low-risk. Logistic regression estimates the probability of a binary outcome:

P(Y=1|x) = 1 / [1 + exp(−(β₀ + βᵀx))]

The model assumes a linear relationship between predictors and log-odds, not necessarily between predictors and probability. A threshold converts probability into an action. A threshold of 0.5 is not automatically appropriate: if missing a failing component costs much more than inspecting a healthy one, a lower threshold may be rational.

A confusion matrix contains true positives, true negatives, false positives and false negatives. Important measures are:

Precision = TP/(TP+FP)
Recall = TP/(TP+FN)
F₁ = 2(Precision × Recall)/(Precision + Recall)

Precision answers, “Among flagged cases, how many are truly positive?” Recall answers, “Among actual positives, how many were found?” F₁ is useful when both matter and neither should dominate, but it may be inappropriate when costs are unequal. Specificity is TN/(TN + FP). ROC-AUC measures ranking discrimination across thresholds; precision–recall curves are often more informative for rare events.

3.3 Trees and nearest-neighbour methods

Decision trees partition the feature space through sequential rules. They are intuitive and can represent nonlinear interactions, but unrestricted trees overfit. Stopping rules, pruning, minimum leaf sizes and validation are necessary.

k-nearest neighbours predicts from nearby training cases. It can be effective when similar operational cases have similar outcomes, but it is sensitive to scaling, irrelevant features and high dimensionality. It also requires storing and accessing historical cases at prediction time.

4. Unsupervised Learning

4.1 Clustering

Clustering groups observations so that within-group similarity is high relative to between-group similarity. In k-means, k centres are chosen to minimise within-cluster squared distance:

J = ∑ᵢ ∥xᵢ − μcᵢ∥²

Here, cᵢ is the cluster assigned to observation i and μcᵢ is its cluster centroid. K-means assumes numerical variables, a meaningful distance measure and clusters that are reasonably compact. Results depend on scaling and initialisation; different values of k should be assessed using business interpretability, stability and measures such as silhouette width—not a single metric alone.

Hierarchical clustering produces a nested tree of groups and can be useful for supplier or product taxonomies. Density-based methods can discover irregular clusters and label isolated points as noise, although parameter selection and changing density present challenges.

Clustering is descriptive, not automatically causal. A segment may be useful for differentiated service, but it should not be treated as a natural or permanent customer identity.

4.2 Anomaly detection

An anomaly is an observation whose behaviour is unusual relative to a reference population. Applications include sensor faults, fraudulent orders, unusual quality measurements and supply disruption signals. Methods include robust statistical rules, isolation forests, one-class support vector machines and autoencoders.

A simple standardised score is:

z = (x − μ)/σ

This is informative only when μ and σ represent a relevant stable reference and the variable is not severely skewed. A high anomaly score is not proof of an error or malicious action. It should trigger investigation, prioritised inspection or data-quality review.

5. Ensemble Methods

Ensembles combine multiple learners. Bagging fits models on resampled data and averages or votes, reducing variance. Random forests add random feature selection to decorrelate trees. Boosting builds models sequentially, emphasising errors made by earlier models; gradient boosting often performs strongly on tabular operational data.

For a regression ensemble with M predictions, an unweighted average is:

Ŷ = (1/M)∑m=1M ŷ(m)

The variance reduction depends on the dependence among model errors; perfectly correlated models provide little ensemble benefit. Ensembles can improve accuracy but may increase computational cost and reduce transparency. Explainability tools and carefully designed operational controls are therefore important.

6. Validation, Overfitting and Uncertainty

6.1 Bias and variance

Underfitting reflects excessive bias: the model is too simple to represent relevant structure. Overfitting reflects excessive variance: the model learns idiosyncrasies of the development data. Increasing model complexity can reduce training error while increasing future error.

A conventional random train/test split is inappropriate when observations are time-dependent, repeated by entity, or affected by interventions. For forecasting, train on earlier periods and validate on later periods. For customer data, group-based splitting may be needed so that the same customer does not appear in both training and test sets.

Cross-validation is a procedure for estimating generalisation performance. Hyperparameter tuning must occur inside the training portion of each fold. A final untouched test set should be used sparingly for an unbiased estimate after model selection.

6.2 Metrics

For numerical prediction, mean absolute error is:

MAE = (1/n)∑ᵢ |yᵢ − ŷᵢ|

It has the same units as the target and treats errors linearly. Root mean squared error is:

RMSE = √[(1/n)∑ᵢ(yᵢ − ŷᵢ)²]

RMSE penalises large errors more strongly. MAPE, 100 × |y − ŷ|/|y|, is undefined when y = 0 and unstable for small y; it should not be used uncritically for intermittent demand. Weighted errors, service-level penalties and inventory cost are often better operational measures.

For probabilistic predictions, calibration matters. A group of cases assigned probability 0.8 should contain approximately 80% positives if the probabilities are well calibrated. Discrimination and calibration are different: a model may rank cases correctly but produce poorly scaled probabilities.

6.3 Temporal and concept drift

Data drift changes the distribution of inputs; concept drift changes the relationship between inputs and outcomes. New suppliers, promotions, regulations, product redesigns or customer policies can cause either. Monitoring should compare current distributions, error rates, calibration and business outcomes against reference baselines. Retraining should be triggered by evidence and operational impact, not by a calendar alone.

7. Explainability and Responsible Use

Explainability serves several audiences: an operator needs actionable reasons, a manager needs evidence of value, a data scientist needs diagnostics, and an auditor needs traceability. Global explanations describe overall relationships; local explanations describe a particular prediction. Feature importance is not automatically causal importance. Correlated features can divide importance unpredictably, and post-hoc explanations can be unstable.

Useful practices include monotonic constraints where domain logic requires them, partial dependence or accumulated local effects with dependence cautions, counterfactual explanations, model cards, decision logs and human review for high-impact actions.

Governance should address:

  • purpose limitation and lawful data use;
  • privacy, consent, retention and access control;
  • fairness across relevant groups and operational contexts;
  • security, adversarial manipulation and data poisoning;
  • accountability for overrides and automated decisions;
  • documentation of data, model version, threshold and deployment date;
  • appeal and correction mechanisms.

Fairness cannot be resolved by a single universal metric. Constraints may conflict across groups, especially when base rates differ. The organisation must identify the harm, legal context and decision authority before selecting a fairness assessment.

8. Applications in Operations Management

Demand and inventory

Regression, gradient boosting and probabilistic forecasting can use calendar, price, promotion, weather, stock availability and product hierarchy features. Stock-outs create censored demand: observed sales may be lower than desired demand. A model trained without recognising this can systematically underforecast. Forecasts should be evaluated at the replenishment horizon and linked to inventory policies, lead time and service targets.

Quality

Classification can prioritise lots for inspection, while regression predicts defect counts or process measurements. Features should be available before the quality decision. Class imbalance is common; accuracy may be misleading when defects are rare. Sampling plans, false-negative costs and process-control signals should complement ML rather than be replaced by it.

Predictive maintenance

Sensor trends, operating regimes, age, load and maintenance history can estimate failure risk or remaining useful life. Random splits can leak asset identity or future maintenance information. Evaluation should reflect warning lead time, missed failures, inspection capacity and the cost of unnecessary interventions. A high-risk score should initiate a maintenance decision, not automatically dictate part replacement.

Churn

Customer activity, service contacts, contract terms and payment behaviour can predict cancellation. The action is usually a retention intervention, so uplift modelling may be more relevant than churn probability alone: the best target is a customer whose behaviour can be changed profitably, not merely one who is likely to leave.

Supply risk

Supplier lead time, capacity, quality, financial indicators, geographic exposure and transportation signals can support risk ranking. Correlated suppliers and common-cause disruptions must be represented. A risk model should be connected to mitigation options such as dual sourcing, safety stock, alternative specifications and escalation protocols.

9. Detailed Applied Case: Illustrative Industrial Maintenance Programme

Background. An illustrative manufacturer operates 420 pumps. Unplanned failures interrupt production, but preventive maintenance on a fixed schedule is costly.

Problem. The organisation wants a seven-day warning of failure risk. Historical records contain vibration, temperature, load, age, maintenance actions and failure events. Only readings available at the prediction time may be used.

Analysis. Engineers first define the unit of analysis as a pump-day and label an observation positive if failure occurs within the next seven days. They discover that a repair-completion code was entered after failure and remove it because it is leakage. Failures represent 2.4% of pump-days, making accuracy unsuitable as the main metric.

Approach. Data are split by time: the first 18 months for development, the next three months for validation and the final three months for testing. A regularised logistic model provides a transparent baseline; a random forest and gradient-boosting model capture nonlinear sensor interactions. Thresholds are selected using the cost of a missed failure, the cost of an inspection and the available maintenance-team capacity. Precision, recall, calibration, warning time and avoided downtime are reported.

Outcome. The ensemble ranks failures more effectively, but the logistic model produces better-calibrated probabilities after calibration. The firm deploys the calibrated model with a daily review queue, not automatic repair orders. Operators can record reasons for overrides, and performance is reviewed separately for pump types and operating regimes. Drift monitoring is introduced after a pump redesign.

Learning points. The case demonstrates that point-in-time data, temporal validation, imbalance-aware evaluation, capacity constraints, calibrated probabilities and human workflow integration are more important than selecting the most complex algorithm. The economic result depends on decisions enabled by the model, not on a score in isolation.

10. Implementation Best Practices

  1. Begin with a measurable decision, baseline and cost of errors.
  2. Establish a point-in-time feature store or equivalent reproducible data process.
  3. Use a simple, interpretable baseline before complex models.
  4. Separate development, tuning, validation and final testing appropriately.
  5. Match metrics and thresholds to operational loss and resource capacity.
  6. Test across time, sites, products, customers and asset types.
  7. Quantify uncertainty and calibrate probabilities where decisions require risk.
  8. Document assumptions, exclusions, data lineage and known failure modes.
  9. Pilot with human oversight and measure outcomes against a credible comparison.
  10. Monitor data, predictions, errors, fairness, drift and business value after deployment.

Contemporary Developments

Modern operations increasingly combine structured ML with probabilistic forecasting, causal inference, digital twins, edge analytics and foundation models. Automated machine learning can accelerate experimentation but does not remove the need for leakage controls or domain validation. Explainable and physics-informed ML can improve trust in maintenance and process applications. Generative AI may assist with feature documentation, code and natural-language interfaces, but generated outputs require verification, access controls and protection of confidential operational data. The strategic direction is therefore not “replace judgement with AI,” but integrate reliable models into accountable decision systems.

Challenges and Limitations

Predictive models inherit historical decisions and may reproduce past inequities or inefficiencies. Rare events provide little training signal. Changing processes invalidate static relationships. Correlation does not establish that an intervention will produce the predicted outcome. Data collection can be expensive, and deployment may create feedback loops: once a model flags a supplier, increased inspection may change the observed defect rate. Finally, accuracy improvements may be economically irrelevant if the organisation lacks capacity to act.

Chapter Summary

Predictive analytics links data to operational decisions through supervised and unsupervised learning. Regression estimates numerical outcomes; classification estimates categories or probabilities; clustering identifies segments; anomaly detection highlights unusual cases; and ensembles combine learners to improve robustness. Feature engineering must respect timing and avoid leakage. Validation must reflect temporal, entity and operational structure, while overfitting is controlled through appropriate complexity, regularisation and honest testing. Metrics should reflect error costs, class imbalance, calibration and business value. Explainability, privacy, fairness, security, documentation and monitoring are essential governance functions. In practice, the strongest solution is usually a validated decision process that combines a suitable model with domain knowledge, human accountability and continuous performance review.

Key Terms

Predictive analytics: Use of data and models to estimate future or unknown outcomes.

Machine learning: Algorithms that learn patterns or functions from data.

Supervised learning: Learning from observations with known target outcomes.

Unsupervised learning: Learning structure without a labelled target.

Regression: Prediction of a numerical outcome.

Classification: Prediction of a categorical outcome or class probability.

Feature engineering: Creation and transformation of model inputs.

Data leakage: Use of information unavailable at the intended prediction time.

Overfitting: Learning sample-specific noise rather than generalisable relationships.

Regularisation: Penalisation used to control model complexity.

Cross-validation: Repeated training and validation procedure for estimating performance.

Calibration: Agreement between predicted probabilities and observed frequencies.

Clustering: Grouping observations according to similarity.

Anomaly detection: Identification of observations unusual relative to a reference population.

Ensemble: Combination of predictions from multiple models.

Concept drift: Change in the relationship between inputs and outcomes.

Precision: Proportion of predicted positives that are actual positives.

Recall: Proportion of actual positives that are detected.

Explainability: Ability to communicate how a model produces or supports a prediction.

Model governance: Policies and controls for responsible model development and use.

Review Questions

Short Answer Questions

  1. Distinguish supervised learning from unsupervised learning and give one operations example of each.
  2. Why is data leakage particularly dangerous in predictive maintenance?
  3. Explain the difference between precision and recall.
  4. What is the purpose of regularisation?
  5. Why can accuracy be misleading for rare quality defects?

Long Answer Questions

  1. Explain a complete predictive analytics workflow for supply-risk management, including data, validation, metrics and governance.
  2. Compare logistic regression, decision trees and ensemble methods for quality classification.
  3. Discuss how feature engineering can improve demand prediction while creating leakage risks.
  4. Explain temporal validation, overfitting, concept drift and post-deployment monitoring.
  5. Evaluate the ethical and managerial issues involved in using ML for customer churn interventions.

Analytical / Application Questions

  1. A maintenance model identifies 80 failures, of which 32 are genuine; it misses 8 genuine failures. Calculate precision, recall and F₁, and explain which operational cost information is still required before selecting a threshold.
  2. Design a point-in-time feature set and validation scheme for predicting whether a supplier shipment will arrive more than three days late.
  3. A clustering project produces different customer segments each month. Diagnose possible causes and recommend tests for stability, usefulness and responsible deployment.

Multiple Choice Questions with Answers

Question 1

Which situation is an example of data leakage?

A. Using supplier lead time recorded before an order is placed

B. Using a repair-completion code entered after an asset has failed

C. Using product category encoded from historical master data

D. Using a rolling demand average calculated from prior periods only

Correct Answer: B. Using a repair-completion code entered after an asset has failed

Question 2

Which metric answers the question: among cases flagged positive, how many are actually positive?

A. Recall

B. Specificity

C. Precision

D. Accuracy

Correct Answer: C. Precision

Question 3

Why is a random train-test split often unsuitable for forecasting data?

A. It prevents all models from using numerical features

B. It can allow information from future periods to influence training

C. It always produces fewer observations

D. It can only be used with classification

Correct Answer: B. It can allow information from future periods to influence training

Question 4

For the values y = 100 and ŷ = 92, what is the absolute error?

A. 4

B. 8

C. 92

D. 192

Correct Answer: B. 8

Question 5

What is the principal purpose of regularisation?

A. To increase data leakage

B. To control model complexity and reduce overfitting

C. To guarantee causal interpretation

D. To remove the need for validation

Correct Answer: B. To control model complexity and reduce overfitting

Question 6

Which method is primarily an unsupervised learning method?

A. Logistic regression

B. Random forest classification

C. K-means clustering

D. Linear regression

Correct Answer: C. K-means clustering

Question 7

If TP = 32 and FN = 8, what is recall?

A. 20%

B. 40%

C. 75%

D. 80%

Correct Answer: D. 80%

Question 8

What does calibration assess in a probabilistic classifier?

A. Whether predicted probabilities correspond to observed frequencies

B. Whether all features have identical units

C. Whether the model has no missing values

D. Whether clusters have equal sizes

Correct Answer: A. Whether predicted probabilities correspond to observed frequencies

Question 9

Which statement about an anomaly score is most accurate?

A. It proves that an observation is fraudulent

B. It identifies an observation as unusual relative to a reference population

C. It replaces all human investigation

D. It is meaningful without defining a reference population

Correct Answer: B. It identifies an observation as unusual relative to a reference population

Question 10

Why can an ensemble reduce prediction variance?

A. It guarantees that every component model is unbiased

B. It combines models whose errors are not perfectly correlated

C. It eliminates the need for features

D. It always makes predictions causal

Correct Answer: B. It combines models whose errors are not perfectly correlated

Business Analytics & Forecasting
Chapter 10 of 14