Big Data & Data-Driven Strategy

Chapter 7
Machine Learning and Artificial Intelligence

Advance Diploma in Business Analytics
Big Data & Data-Driven Strategy   •   Advance Diploma

Machine Learning and Artificial Intelligence

Introduction and Context

Artificial intelligence (AI) refers broadly to computational systems that perform tasks commonly associated with human intelligence, such as perception, language understanding, reasoning, prediction and decision-making. Machine learning (ML) is a major approach within AI in which systems learn patterns from data rather than being programmed with an explicit rule for every situation. In business analytics, ML converts historical and streaming data into predictions, classifications, recommendations and automated actions.

The strategic value of ML does not arise from using sophisticated algorithms alone. Value depends on selecting a meaningful business problem, obtaining appropriate data, engineering reliable features, evaluating models honestly and embedding outputs into decisions. A highly accurate model may still fail if its predictions arrive too late, cannot be explained, create regulatory risk or are ignored by employees and customers.

A useful distinction is:

  • Descriptive analytics explains what has happened.
  • Diagnostic analytics investigates why it happened.
  • Predictive analytics estimates what is likely to happen.
  • Prescriptive analytics recommends or automates an action.

ML primarily supports predictive and prescriptive analytics, although unsupervised learning is also valuable for descriptive discovery.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Distinguish supervised, unsupervised and reinforcement learning.
  2. Select suitable ML methods for business problems.
  3. Explain data preparation and feature engineering, including leakage prevention.
  4. Evaluate models using metrics appropriate to the decision context.
  5. Explain the foundations and applications of generative AI and natural language processing.
  6. Identify limitations, ethical risks, governance requirements and appropriate use cases.
  7. Assess how ML can be integrated into a data-driven strategy.

1. The Machine-Learning Problem

A machine-learning system learns a relationship between inputs and an outcome. Let the input vector be x = (x1, x2, …, xp), where the xj are features, and let y be the target. A model produces a prediction \hat{y} = f_θ(x), where θ represents learned parameters.

Training estimates parameters using historical data. In a general supervised-learning formulation, the model minimizes an empirical loss:

θ̂ = arg min_θ (1/n) ∑i=1n L(yi, f_θ(xi))

Here, n is the number of training observations, L is a loss function, yi is the observed target and f_θ(xi) is the prediction. This formulation assumes that observations and targets are defined consistently and that minimizing the selected loss is aligned with the business objective. Regularization, constraints and validation procedures are often added to reduce overfitting.

Overfitting occurs when a model learns accidental details or noise in the training data and performs poorly on new data. Underfitting occurs when the model is too simple to represent important relationships. The central objective is generalization: reliable performance on relevant future observations.

Types of learning

TypeTraining signalTypical outputBusiness examples
SupervisedKnown target labelsPrediction or classChurn, fraud, demand
UnsupervisedNo target labelsGroups, structure or anomaliesSegmentation, network discovery
ReinforcementRewards from actionsPolicy or action choicePricing, routing, resource allocation
Self-supervisedTargets constructed from dataRepresentations or generated contentLanguage models, embeddings

2. Supervised Learning

Supervised learning uses examples in which the desired outcome is known. Regression predicts a numerical quantity, such as sales or delivery time. Classification predicts a category, such as fraudulent/not fraudulent or likely to renew/unlikely to renew.

Regression

In simple linear regression, a numerical target is modelled as:

yi = β0 + β1xi + εi

yi is the observed outcome, xi is a predictor, β0 is the intercept, β1 is the expected change in the outcome for a one-unit increase in xi, and εi is an error term. The equation assumes a linear conditional relationship, correctly measured variables and errors with mean zero conditional on the predictors. Multiple regression extends the model to several predictors.

Linear models are transparent and often effective when relationships are approximately additive. Tree-based methods, random forests and gradient-boosting models can represent non-linear relationships and interactions, but they require careful validation and may be more difficult to explain.

Classification

A common binary-classification model is logistic regression. It estimates the probability of class 1 as:

P(y = 1 | x) = 1 / [1 + e-(β0 + β1x1 + … + βpxp)]

The output lies between 0 and 1. A classification threshold converts the probability into an action; for example, a probability above 0.70 may trigger a manual review. The threshold should reflect the relative costs of false positives and false negatives, not simply default to 0.50.

A confusion matrix summarizes binary predictions:

Actual positiveActual negative
Predicted positiveTrue positive (TP)False positive (FP)
Predicted negativeFalse negative (FN)True negative (TN)

Important measures are:

Accuracy = (TP + TN) / (TP + TN + FP + FN)
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
F1 = 2 × (Precision × Recall) / (Precision + Recall)

Accuracy measures the proportion of all correct predictions. Precision measures how many predicted positives are actually positive. Recall, also called sensitivity, measures how many actual positives are detected. F1 is the harmonic mean of precision and recall and is useful when both matter. These formulas require non-zero denominators. Accuracy can be misleading with imbalanced classes; a fraud model that labels every transaction legitimate may appear accurate while detecting no fraud.

For probability predictions, log loss penalizes confident incorrect predictions more heavily than less confident errors. ROC-AUC measures ranking performance across classification thresholds, while PR-AUC is often more informative when the positive class is rare. No metric is universally best: evaluation must reflect the operational decision.

Common supervised algorithms

  • Linear and logistic regression: interpretable baselines; useful where relationships are relatively simple.
  • Decision trees: readable rule structures, although individual trees can overfit.
  • Random forests: ensembles of trees that generally improve stability through averaging.
  • Gradient boosting: sequentially builds trees to correct prior errors and often performs strongly on tabular data.
  • Support vector machines: seek separating boundaries and can model complex boundaries with kernels, but may be less convenient at very large scale.
  • Neural networks: learn layered representations and are particularly powerful for images, audio, language and high-dimensional data.

3. Unsupervised Learning

Unsupervised learning works without a labelled target. It seeks useful structure, such as customer groups, latent dimensions or unusual records. Its results are exploratory rather than automatically causal: a cluster is a statistical grouping, not necessarily a naturally existing market segment.

Clustering

In k-means clustering, the analyst chooses k clusters and assigns each observation to the nearest centroid. The objective is to minimize within-cluster squared distance:

J = ∑j=1k ∑xi ∈ Cj ||xi − μj||²

Here, Cj is cluster j, μj is its centroid and the norm represents Euclidean distance. The method assumes that distance is meaningful, features are appropriately scaled and clusters are reasonably compact. Because results depend on initialization and the chosen k, analysts should use multiple starts, compare alternative values and interpret the clusters using business knowledge.

Before distance-based methods, variables measured on different scales should often be standardized:

z = (x − μ) / σ

Here, μ is the sample mean and σ is the sample standard deviation. The standardized value has no physical unit. Scaling is not always desirable—for example, when the original units have direct business meaning or a model is insensitive to scale.

Other unsupervised methods include hierarchical clustering, density-based clustering, principal component analysis (PCA) and anomaly detection. PCA creates orthogonal components that capture decreasing amounts of variance. It can reduce dimensionality but may reduce interpretability. Anomaly detection can identify unusual transactions, equipment states or user behaviour; unusual does not necessarily mean fraudulent or harmful.

4. Reinforcement Learning

Reinforcement learning (RL) models sequential decision-making. An agent observes a state, chooses an action, receives a reward and moves to a new state. The objective is to learn a policy that maximizes expected cumulative reward.

A standard discounted return is:

Gt = rt+1 + γrt+2 + γ²rt+3 + …

Gt is the return from time t, rt+1 is the next reward and γ, where 0 ≤ γ < 1, is the discount factor. A lower discount factor emphasizes immediate rewards; a value near one gives greater importance to future rewards. The formulation assumes that rewards are defined consistently and that the environment can be represented sufficiently by the state.

RL is appropriate when decisions influence future states and outcomes, such as warehouse routing, energy control, advertising allocation or dynamic resource scheduling. It is usually inappropriate to deploy directly in high-stakes settings without safe exploration, because learning through harmful trial and error is unacceptable. Simulation, offline evaluation, constrained actions and human oversight are important safeguards.

5. Data Preparation and Feature Engineering

Model performance is frequently limited more by data quality than by algorithm choice. A practical workflow includes:

  1. Define the prediction target, decision owner, prediction time and action window.
  2. Inspect data types, missingness, duplicates, outliers and inconsistent values.
  3. Establish a time-aware data cut-off.
  4. Split data into training, validation and test sets.
  5. Fit preprocessing transformations using training data only.
  6. Engineer features and document their provenance.
  7. Train, validate, stress-test and monitor the model.

Feature engineering

A feature is a measurable input used by a model. Feature engineering may include:

  • aggregating transactions over a defined period;
  • extracting day, week or season from dates;
  • calculating recency, frequency and monetary value;
  • encoding categorical variables;
  • transforming highly skewed values;
  • creating interaction features;
  • generating text embeddings or image representations;
  • incorporating domain-specific ratios and indicators.

The time reference is essential. Suppose a model predicts whether a customer will cancel in the next 30 days. A feature derived from a cancellation survey completed after the prediction date is target leakage, even if it produces excellent test results. Leakage causes an apparently successful model to fail in production.

Missing values can represent different conditions: unavailable information, a non-occurring event or a data-capture failure. Imputation should be fitted on training data, and the approach should be documented. Sensitive variables may be excluded, but their omission does not guarantee fairness because proxy variables can reproduce sensitive characteristics.

Data splitting and validation

A random split is often reasonable when observations are independent and identically distributed. For time-dependent data, training must precede validation and testing chronologically. For repeated observations of the same customer, records from one customer may need to remain in one partition to avoid overly optimistic results. Cross-validation is useful for model selection, but it must be designed to respect groups, time and preprocessing boundaries.

6. Model Evaluation and Operational Performance

A model should be evaluated at three levels:

  1. Statistical performance: Does it predict accurately on unseen data?
  2. Operational performance: Can it function within latency, cost and workflow constraints?
  3. Business performance: Does it improve a decision or outcome relative to a credible baseline?

For regression, common metrics include:

MAE = (1/n) ∑i=1n |yi − ŷi|
RMSE = √[(1/n) ∑i=1n (yi − ŷi)²]

MAE is the average absolute error and uses the same units as the target. RMSE also uses the target’s units but penalizes large errors more strongly because errors are squared before averaging. These measures assume comparable target units and should not be interpreted without considering business costs.

A model’s calibration concerns whether predicted probabilities correspond to observed frequencies. Among cases assigned a probability of 0.8, approximately 80% should be positive in a well-calibrated group. Ranking and calibration are different: a model may rank cases correctly while producing poorly calibrated probabilities.

Evaluation should compare the model with a simple baseline, such as last-period demand, a majority class or an existing business rule. It should also examine performance by geography, customer segment, product, language and other relevant groups. Fairness analysis may involve comparing error rates, selection rates or calibration, but fairness criteria can conflict; the appropriate choice requires legal, social and organizational judgment.

After deployment, performance can deteriorate through data drift (changes in input distributions), concept drift (changes in the relationship between inputs and outcomes) or changes in user behaviour. Monitoring should include input quality, prediction distributions, outcome metrics when labels arrive, latency, costs, complaints and override rates.

7. Generative AI

Traditional predictive ML estimates an outcome or decision. Generative AI creates new content—text, images, audio, video, code or synthetic data—based on patterns learned from training data. Large language models (LLMs) are neural networks trained to represent and generate language. A simplified language objective is to predict the next token given preceding tokens:

P(xt | x1, x2, …, xt−1)

Here, xt is the next token and the preceding symbols are the context. During generation, the system repeatedly selects or samples tokens. Temperature and related decoding controls affect variability, but they do not guarantee truth.

Modern LLMs commonly use the transformer architecture, which uses attention to relate tokens across a context. An attention mechanism computes weighted combinations of value representations; conceptually, the weights reflect the relevance of other tokens to the current token. The technical architecture is important, but business users should focus equally on data provenance, confidentiality, evaluation and human accountability.

Generative AI applications include document drafting, summarization, customer-service assistance, code support, information retrieval and scenario generation. Retrieval-augmented generation (RAG) retrieves approved documents and supplies them as context to a generative model. RAG can improve grounding and source traceability, but it cannot correct incomplete documents, poor retrieval or an unreliable underlying model.

Important risks include hallucinated content, outdated information, prompt injection, confidential-data exposure, copyright disputes, bias and excessive automation. Generative systems should not be treated as authoritative merely because their output is fluent. High-impact outputs require source checking, access controls, logging and human review.

8. Natural Language Processing

Natural language processing (NLP) applies computational methods to human language. A typical pipeline may include document collection, language detection, cleaning, tokenization, representation, modelling and evaluation. Earlier systems used word counts, n-grams and term frequency–inverse document frequency (TF-IDF). Modern systems often use dense vector representations called embeddings, in which semantically related items tend to have similar locations in a vector space.

NLP tasks include:

  • sentiment and emotion classification;
  • topic discovery;
  • named-entity recognition;
  • document and email classification;
  • search and question answering;
  • summarization and translation;
  • speech recognition and conversational interfaces.

Text models can encode social and historical biases present in training data. Language variation, sarcasm, domain terminology, multilingual content and low-resource languages create additional challenges. Evaluation should use representative data and task-specific measures, while also checking factuality, harmful outputs and performance across demographic and linguistic groups.

9. A Practical Decision Framework

An organization should not begin with “Which algorithm should we use?” It should begin with the decision. The following sequence is useful:

  1. Clarify the decision: What action will change because of the prediction?
  2. Define value and harm: What benefits, costs and risks follow from errors?
  3. Check feasibility: Are labels, features, infrastructure and skills available?
  4. Select the learning paradigm: Use supervised learning for known outcomes, unsupervised learning for structure discovery and RL for sequential action optimization.
  5. Establish a baseline: Compare against current practice.
  6. Pilot safely: Use a controlled trial or shadow deployment.
  7. Integrate the workflow: Specify ownership, escalation and override procedures.
  8. Monitor and improve: Revalidate as data, markets and policies change.

A model is a component of a socio-technical system. Governance must specify who may use it, for what purpose, with which data, under what retention rules and with what appeal or correction mechanism.

10. Illustrative Case: Predicting Retail Customer Churn

Background

A subscription retailer experiences increasing customer cancellations. Management wants an early-warning system so that service teams can offer appropriate assistance before cancellation.

Problem

The analytics team defines the target as cancellation within the next 30 days, using only information available at the weekly prediction time. The business wants to prioritize a limited number of outreach contacts, not contact every customer.

Analysis

Historical data contain order frequency, time since last purchase, support interactions, subscription age, product category and payment events. The team discovers that a cancellation survey field is completed only after a customer has indicated an intention to cancel. Including it would create leakage, so it is excluded. The data are split chronologically: earlier months for training, a later period for validation and the most recent period for testing.

Because only 6% of customers cancel in a typical month, accuracy is rejected as the primary metric. The team examines precision, recall, PR-AUC and calibration at the number of contacts the service team can actually make. It also checks performance across regions and subscription types.

Approach and solution

A regularized logistic-regression model provides an interpretable baseline. A gradient-boosting model improves ranking but is reviewed using explanations and calibration checks. The business chooses a threshold based on the expected value of an intervention:

Expected value = (TP × benefit) − (FP × contact cost) − intervention cost

This is a simplified decision equation. TP is the number of correctly identified likely cancellers, benefit is the net value of preventing one cancellation, FP is the number of unnecessary contacts and contact cost is the cost per contact. The equation assumes the quantities are estimated consistently and that the intervention effect is not incorrectly attributed to the model.

Rather than assuming that every contacted customer is saved, the retailer conducts a randomized controlled pilot: eligible high-risk customers are randomly assigned to outreach or a control group. This estimates the incremental effect of outreach. The model is used to prioritize treatment, while the experiment measures whether the treatment works.

Outcome

The pilot shows that targeted outreach reduces cancellations in one segment but has little effect in another. Management therefore limits the programme to the responsive segment, introduces human review for unusual cases and monitors performance monthly. The model is not allowed to deny service or change prices automatically.

Learning points

  • A well-defined prediction time prevents leakage.
  • Class imbalance makes operational metrics more useful than accuracy alone.
  • Predictive accuracy does not prove that an intervention causes improvement.
  • Experiments are needed to estimate incremental business value.
  • Responsible deployment includes human oversight, monitoring and limits on automated action.

11. Limitations, Ethics and Governance

ML systems learn from historical data and may reproduce historical discrimination, measurement errors or institutional priorities. Correlation is not causation: a predictive feature may be useful without explaining why an outcome occurs. A model may also fail under distribution shift, rare events, adversarial behaviour or new market conditions.

Key governance practices include:

  • data minimization and lawful processing;
  • clear purpose limitation and retention policies;
  • access controls, encryption and audit logs;
  • documentation of data sources, assumptions and model versions;
  • explainability appropriate to the decision and audience;
  • bias and impact assessments;
  • security testing and red-team evaluation;
  • human review, contestability and appeal mechanisms;
  • incident response and model retirement criteria.

Regulatory requirements vary by jurisdiction and application. High-impact uses such as employment, credit, insurance, healthcare and public services generally require stronger controls than low-risk recommendation systems. Compliance is not equivalent to ethical adequacy: organizations should consider dignity, autonomy, privacy, safety and distributional consequences even where a use is technically lawful.

12. Contemporary Developments and Best Practice

Current practice is moving toward foundation models, multimodal systems, smaller specialized models, synthetic data, automated machine learning, edge inference and responsible-AI engineering. These developments reduce some barriers to adoption but may increase dependency on vendors, computational cost, privacy risk and evaluation complexity.

Effective organizations typically:

  1. maintain a portfolio of use cases linked to strategic priorities;
  2. begin with measurable decisions rather than technology demonstrations;
  3. use simple, interpretable baselines before complex models;
  4. separate development, validation and approval responsibilities;
  5. version data, code, features and models;
  6. test for leakage, drift, robustness and subgroup performance;
  7. use human-centred workflow design;
  8. measure realized outcomes rather than only offline scores;
  9. provide training and accountability for users;
  10. retire models that no longer meet their purpose or risk threshold.

Chapter Summary

Machine learning is a central capability of data-driven strategy, but its value depends on the complete decision system surrounding the model. Supervised learning predicts labelled outcomes through regression and classification. Unsupervised learning discovers structure without target labels, while reinforcement learning optimizes sequential actions through rewards. Feature engineering, appropriate data splitting and leakage prevention are essential for credible results. Evaluation should combine statistical metrics, operational constraints, business value, calibration and subgroup analysis. Generative AI produces new content and NLP enables systems to process and generate language, but both require careful grounding, security and human oversight. Ethical deployment requires privacy protection, fairness assessment, transparency, monitoring, accountability and limits on automation. The most effective ML programmes begin with a well-defined decision and measure whether the resulting intervention creates sustainable value.

Key Terms

Artificial intelligence: Computational capability associated with tasks such as reasoning, perception, language and decision-making.

Machine learning: Methods that learn patterns from data to produce predictions or actions.

Supervised learning: Learning from examples with known target outcomes.

Unsupervised learning: Learning structure from data without labelled targets.

Reinforcement learning: Learning actions through interaction and rewards.

Feature: An input variable used by a model.

Target: The outcome a supervised model is trained to predict.

Feature engineering: Creating or transforming inputs to improve usefulness for modelling.

Target leakage: Use of information unavailable at prediction time or caused by the target.

Overfitting: Strong training performance combined with poor generalization.

Classification: Prediction of a categorical outcome.

Regression: Prediction of a numerical outcome.

Precision: The proportion of predicted positives that are actual positives.

Recall: The proportion of actual positives that are detected.

Calibration: Agreement between predicted probabilities and observed frequencies.

Generative AI: AI that creates new text, images, audio, code or other content.

Natural language processing: Computational analysis and generation of human language.

Embedding: A numerical representation that captures relationships among items.

Data drift: Change in the distribution of model inputs over time.

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

Review Questions

Short Answer Questions

  1. What is the difference between supervised and unsupervised learning?
  2. Define target leakage and explain why it is harmful.
  3. What does recall measure in a binary-classification problem?
  4. Why may accuracy be unsuitable for a highly imbalanced dataset?
  5. State two risks associated with generative AI.

Long Answer Questions

  1. Explain the end-to-end workflow for developing and deploying a business ML model.
  2. Compare regression, classification, clustering and reinforcement learning, giving one suitable business use case for each.
  3. Explain how feature engineering, data splitting and validation affect model reliability.
  4. Discuss the difference between statistical performance, operational performance and business performance.
  5. Explain the ethical and governance requirements for deploying AI in a high-impact business decision.

Analytical / Application Questions

  1. A bank wants to identify rare fraudulent transactions. Recommend evaluation metrics and explain why accuracy alone is inadequate. Discuss the trade-off between false positives and false negatives.
  2. A retailer builds a churn model using customer data collected after cancellation. Diagnose the methodological problem, redesign the prediction process and propose a suitable pilot evaluation.
  3. An organization wants an LLM to answer questions about internal policies. Design a responsible implementation using retrieval, access control, evaluation, human review and monitoring.

Multiple Choice Questions with Answers

Question 1

Which learning paradigm is most appropriate when the historical outcome to be predicted is known for each training record?

A. Supervised learning

B. Unsupervised learning

C. Reinforcement learning

D. Random sampling

Correct Answer: A. Supervised learning

Question 2

A fraud model identifies 90% of fraudulent transactions but also flags many legitimate transactions. Which metric describes the proportion of flagged transactions that are actually fraudulent?

A. Recall

B. Precision

C. Accuracy

D. Calibration

Correct Answer: B. Precision

Question 3

Why is a feature based on a cancellation survey completed after a prediction date problematic in a churn model?

A. It causes underfitting

B. It creates target leakage

C. It standardizes the data

D. It guarantees calibration

Correct Answer: B. It creates target leakage

Question 4

Which method is primarily designed to group observations without a labelled target?

A. Logistic regression

B. K-means clustering

C. Linear regression

D. Binary classification

Correct Answer: B. K-means clustering

Question 5

In reinforcement learning, what does the discount factor control?

A. The number of input features

B. The importance assigned to future rewards

C. The proportion of missing values

D. The classification threshold

Correct Answer: B. The importance assigned to future rewards

Question 6

A binary model has TP = 30, FP = 10, FN = 20 and TN = 940. What is its recall?

A. 30%

B. 60%

C. 75%

D. 97%

Correct Answer: B. 60%

Question 7

Which regression metric is in the same units as the target and does not square individual errors?

A. MAE

B. RMSE

C. Accuracy

D. ROC-AUC

Correct Answer: A. MAE

Question 8

What is a principal purpose of retrieval-augmented generation?

A. To remove the need for source documents

B. To provide retrieved contextual information to a generative model

C. To guarantee that every generated statement is true

D. To replace access controls

Correct Answer: B. To provide retrieved contextual information to a generative model

Question 9

Which situation is most likely to require a time-based rather than random train-test split?

A. Predicting future demand from historical time-series data

B. Classifying shuffled laboratory images

C. Grouping products by colour

D. Counting unique categories

Correct Answer: A. Predicting future demand from historical time-series data

Question 10

What does model calibration assess?

A. Whether predicted probabilities correspond to observed frequencies

B. Whether a model has the largest possible number of features

C. Whether all errors are exactly zero

D. Whether clusters have equal names

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

Big Data & Data-Driven Strategy
Chapter 7 of 15