Machine Learning Algorithms

Chapter 1
Machine Learning Foundations and Business Problem Formulation

Post Graduate Program in Business Analytics
Machine Learning Algorithms   •   Post Graduate

Machine Learning Foundations and Business Problem Formulation

Introduction

Machine learning (ML) is the study and practice of building computational systems that improve their performance on a task through experience, usually represented by data. In business analytics, that experience may consist of customer transactions, sensor readings, employee records, web interactions, financial histories, or operational events. The purpose is not merely to fit a sophisticated model. It is to support a decision, automate a process, discover a pattern, estimate an outcome, or learn something credible about a business system.

A technically accurate model can still be commercially useless. For example, a churn model may achieve high predictive accuracy but fail to identify customers who can actually be retained. Similarly, a demand forecast may be statistically strong but arrive too late for procurement decisions. Effective machine learning therefore begins before algorithm selection: the analyst must formulate the business problem, define the unit of analysis, identify the target, establish the decision context, and specify how success will be measured.

This chapter develops those foundations. It distinguishes predictive from causal questions, explains major learning paradigms, introduces the algorithmic workflow, examines bias–variance trade-offs, and presents a disciplined method for translating business objectives into measurable analytics problems.

Learning Objectives

After studying this chapter, a learner should be able to:

  1. Define fundamental machine-learning terminology accurately.
  2. Distinguish supervised, unsupervised, semi-supervised, self-supervised, and reinforcement learning.
  3. Formulate business questions as well-defined analytics problems.
  4. Differentiate prediction, description, and causal inference.
  5. Explain training, validation, testing, generalisation, overfitting, underfitting, and data leakage.
  6. Interpret the bias–variance trade-off and select evaluation metrics appropriate to decisions.
  7. Design a responsible end-to-end machine-learning workflow.

1. The Conceptual Foundations of Machine Learning

1.1 Data, observations, features, and targets

A dataset is commonly represented as a collection of observations. An observation is the entity, event, or time period being analysed: a customer, an invoice, a patient visit, or a product-day. Features, also called predictors or independent variables, are measurable attributes used by a model. The target, label, or response is the outcome to be predicted or explained.

Let a dataset be represented by pairs:

D = {(xi, yi)}i=1n

Here, xi is the feature vector for observation i, yi is its target, and n is the number of observations. A feature vector may contain numerical, categorical, text, image, spatial, or temporal information. In unsupervised learning, the target yi is not supplied.

A model is a parameterised function that maps inputs to outputs:

ŷ = f(x; θ)

The symbol ŷ denotes a prediction, f is the model function, and θ represents learned parameters. The model is trained by optimising an objective, often a loss function that measures disagreement between predictions and observed targets.

For regression, a commonly used loss is mean squared error (MSE):

MSE = (1/n) ∑i=1n(yi − ŷi)2

MSE is applicable when the target is numerical and squared errors are an appropriate representation of business cost. Its units are the square of the target’s units. Root mean squared error is therefore often easier to interpret:

RMSE = √[(1/n) ∑i=1n(yi − ŷi)2]

For binary classification, a model may estimate P(Y=1|x), the probability that an observation belongs to class 1. A threshold converts probability into an action or class prediction. The threshold should be chosen in relation to the consequences of false positives and false negatives, not automatically set to 0.5.

1.2 Parameters, hyperparameters, and algorithms

An algorithm is a procedure for learning from data; a model is the fitted result. Parameters are values learned during training, such as regression coefficients or the weights in a neural network. Hyperparameters are specified before or around training, such as tree depth, regularisation strength, learning rate, or number of neighbours.

A loss function measures predictive error during learning. A performance metric measures usefulness during evaluation. These may differ. For example, a training algorithm may minimise log loss, while management evaluates recall among high-risk customers and the financial value of interventions.

Generalisation is the ability to perform well on new observations drawn from the relevant operating environment. It is the central objective of machine learning. A model that memorises the training sample without learning stable relationships has poor generalisation.

1.3 Training, validation, and test data

A training set is used to estimate model parameters. A validation set supports model selection, hyperparameter tuning, and threshold selection. A test set is held back until the modelling decisions are substantially complete and provides an approximately unbiased estimate of final out-of-sample performance.

The split must respect the data-generating process. In a forecasting problem, random splitting can place future information in the training set. A time-based split is generally more appropriate: earlier periods for training, a later period for validation, and the most recent period for testing. If observations are grouped by customer, patient, household, or firm, group-based splitting may be necessary to prevent the same entity appearing in both training and test data.

Data leakage occurs when information unavailable at decision time enters training or evaluation. Examples include using a post-cancellation service record to predict cancellation, calculating a feature using the entire dataset before splitting, or allowing a future transaction to influence a historical prediction. Leakage often produces impressive but misleading results.

2. Learning Paradigms

2.1 Supervised learning

In supervised learning, examples contain input features and known targets. The two principal tasks are:

  • Regression: predicting a continuous quantity, such as revenue, delivery time, or demand.
  • Classification: predicting a discrete category, such as default versus non-default or fraud versus legitimate transaction.

Classification may be binary or multiclass. Multilabel classification permits an observation to belong to several classes simultaneously. Supervised learning is appropriate when a target is operationally defined and historical examples are sufficiently representative.

2.2 Unsupervised learning

Unsupervised learning analyses data without a labelled target. Clustering groups observations according to similarity; dimensionality reduction represents high-dimensional data with fewer dimensions; anomaly detection identifies observations that differ substantially from normal patterns.

Unsupervised outputs are often exploratory rather than automatically actionable. A cluster is not inherently a customer segment with a business meaning. Analysts must assess stability, interpretability, and usefulness, and should avoid presenting discovered groups as natural or causal categories without evidence.

2.3 Semi-supervised and self-supervised learning

Semi-supervised learning combines a small labelled dataset with a larger unlabelled dataset. It can be useful when labels are expensive, such as expert review of medical images or classification of legal documents.

Self-supervised learning creates supervisory signals from the data itself. For example, a language model may learn to predict a masked word, while a representation model may learn relationships among parts of an image. The learned representation can later support supervised business tasks. Self-supervision is a training strategy, not proof that the resulting representation is unbiased or fit for every downstream decision.

2.4 Reinforcement learning

In reinforcement learning, an agent interacts with an environment, takes actions, receives rewards, and learns a policy for choosing actions. It is suited to sequential decision problems in which current actions influence future states and rewards. Examples include inventory control, recommendations, and dynamic pricing. However, offline business data may not reveal what would have happened under unobserved actions; this makes evaluation and causal assumptions especially important.

ParadigmTraining signalTypical business useMain caution
SupervisedKnown labelsForecasting, risk scoringLabel quality and leakage
UnsupervisedStructure in inputsSegmentation, anomaly detectionInterpretation and stability
Semi-supervisedFew labels plus unlabelled dataDocument or image classificationLabelled sample representativeness
Self-supervisedData-derived taskRepresentation learningDownstream validity and bias
ReinforcementRewards from interactionSequential controlExploration risk and counterfactual evaluation

3. From Business Objective to Analytics Problem

A business objective is usually expressed in broad language: “reduce churn,” “improve inventory availability,” “detect fraud,” or “increase campaign effectiveness.” Such statements are not yet machine-learning specifications. A disciplined formulation connects five elements:

  1. Decision: What action will be taken?
  2. Decision-maker: Who or what will take it?
  3. Unit and timing: For which entity and at what point in time?
  4. Outcome: What measurable result matters?
  5. Constraints: What costs, fairness requirements, capacity limits, and regulations apply?

A useful formulation template is: “At time t, for each unit i, use information available by t to estimate [outcome] over [horizon], so that [decision] can be made subject to [constraints].”

3.1 Defining the unit of analysis and prediction horizon

Ambiguity about the unit of analysis creates inconsistent labels and invalid evaluation. A churn problem might define the unit as a customer-month, while an operational intervention may occur at the account level. The prediction horizon should be explicit: for example, cancellation within 30 days after the scoring date.

The observation window contains information used to construct features. The forecast or outcome window contains the period in which the target is measured. These windows must not overlap in a way that permits future information to enter the predictors.

3.2 Prediction, description, and causation

A predictive question asks what is likely to happen:

Which customers are most likely to cancel within the next 30 days?

A descriptive question asks what patterns exist:

Which customer groups have similar purchasing behaviour?

A causal question asks what would happen under an intervention:

Would offering a retention incentive reduce cancellation, and for whom?

Prediction and causation are not equivalent. A feature can be highly predictive without being a useful intervention target. For example, a cancellation request may strongly predict churn, but it occurs too late to prevent it. Conversely, a variable may have a causal influence while offering weak predictive power. Causal claims require stronger assumptions and designs, such as randomised experiments, natural experiments, or carefully justified observational methods.

A treatment-effect question concerns differences between potential outcomes. For individual i, let Yi(1) denote the outcome if treated and Yi(0) the outcome if untreated. The individual treatment effect is:

τi = Yi(1) − Yi(0)

Only one of these potential outcomes is observed for each individual, which is the fundamental challenge of causal inference. A predictive propensity score, such as probability of churn, does not by itself estimate τi.

3.3 Choosing a target and metric

A target must be observable, operationally meaningful, and defined before modelling. “Customer value” may require a precise time horizon and accounting definition. “Fraud” may be based on confirmed investigations rather than initial alerts. Label delay and label noise should be documented.

Metrics should reflect decision costs. For a binary classifier:

Precision = TP/(TP + FP)
Recall = TP/(TP + FN)

Here, TP, FP, FN, and TN are true positives, false positives, false negatives, and true negatives. Precision answers: among flagged cases, how many are positive? Recall answers: among actual positives, how many were found? Accuracy, (TP+TN)/(TP+FP+FN+TN), can be misleading when the positive class is rare.

If false-positive cost is CFP and false-negative cost is CFN, a simplified expected classification cost is:

Cost = CFP × FP + CFN × FN

This formula assumes costs are additive and that true-positive and true-negative benefits are either negligible or included separately. In practice, analysts may estimate expected profit by including treatment cost, recovered value, investigation capacity, and customer impact.

For ranking models, precision at k, recall at k, lift, and gain may be more relevant than a global threshold metric. For probability forecasts, calibration matters: among cases assigned probability 0.7, approximately 70% should experience the outcome over a sufficiently large and comparable group. For regression, MAE is:

MAE = (1/n) ∑i=1n|yi − ŷi|

MAE is in the same units as the target and gives linear weight to errors. RMSE penalises large errors more strongly. The choice should follow the decision loss, not convention.

4. The Machine-Learning Workflow

A robust workflow is iterative rather than strictly linear.

Step 1: Frame the decision

Identify the owner of the decision, available interventions, timing, capacity, and consequences of errors. If no action follows a prediction, the project may be descriptive rather than decision-supportive.

Step 2: Audit data-generating processes

Document source systems, collection procedures, missingness, sampling, access rights, definitions, and known changes. Missingness may itself contain operational information, but it can also reflect unequal service or measurement practices.

Step 3: Construct the analytical dataset

Define the observation unit, index date, observation window, outcome window, and feature cutoff. Create labels using only information available after the index date but within the defined outcome window. Record transformations in reproducible code or data specifications.

Step 4: Establish a baseline

A baseline may be a majority-class classifier, seasonal-naïve forecast, simple mean, logistic regression, or business rule. Complex models should demonstrate incremental value over a transparent benchmark.

Step 5: Split and validate appropriately

Use stratification when suitable for imbalanced classification, groups when entities recur, and temporal validation for changing environments. Cross-validation estimates variability across training-validation partitions, but it does not remove leakage or replace a final untouched test period.

Step 6: Train, tune, and compare

Compare models using pre-specified metrics and practical constraints such as latency, interpretability, memory, and maintenance. Hyperparameter search should be nested within the training-development process; repeated test-set inspection turns the test set into another tuning set.

Step 7: Evaluate beyond a single score

Examine subgroup performance, calibration, threshold behaviour, error cases, stability over time, and operational capacity. A model that performs well overall may fail for a strategically important or legally protected group.

Step 8: Deploy, monitor, and govern

Deployment requires data pipelines, versioning, access controls, audit logs, rollback procedures, and ownership. Monitor input drift, target drift, performance, calibration, latency, fairness indicators, and changes in business policy. Retraining should be triggered by evidence, not an arbitrary schedule alone.

5. Bias, Variance, and Model Complexity

Bias is systematic error arising when a model is too restrictive or its assumptions do not capture the underlying relationship. Variance is sensitivity to the particular training sample. A flexible model generally has lower training error but may have high variance; a simple model may have higher bias but lower variance.

For squared-error prediction, expected test error can be conceptually decomposed as:

Expected test error = Bias² + Variance + Irreducible noise

This is a conceptual decomposition under standard assumptions, including a fixed input and squared-error loss. Irreducible noise reflects randomness or omitted information that cannot be eliminated by choosing a more complex model. The terms are not directly observable in a single fitted model, but resampling and learning curves can provide evidence about the trade-off.

Underfitting occurs when a model is too simple to capture useful structure. Overfitting occurs when it captures sample-specific noise or peculiarities. Regularisation constrains model complexity. For example, ridge regression minimises:

∑i=1n(yi − β0 − βᵀxi)2 + λ∑j=1pβj2

Here, β0 is the intercept, β is the coefficient vector, p is the number of features, and λ ≥ 0 controls the penalty. The penalty is added to the squared-error objective; it does not change the units of the fitted target unless the objective is appropriately scaled. Features should generally be standardised when coefficient penalties are used, because otherwise measurement scale affects the penalty. Larger λ increases shrinkage and may reduce variance at the cost of increased bias.

The practical goal is not minimum training error but the best expected performance on relevant future data subject to business and governance constraints.

6. Illustrative Case: Retention Analytics at Northstar Telecom

The following is a fictional illustrative case.

Background

Northstar Telecom observes rising monthly cancellations among small-business customers. Management proposes a machine-learning system to “predict churn and save customers.” The retention team can contact only 8,000 accounts each month and can offer discounts or service reviews.

Problem formulation

The initial statement is refined as follows: on the first day of each month, estimate the probability that each active small-business account will cancel within the next 30 days, using information available by the scoring date. Rank accounts for retention outreach, subject to an 8,000-account capacity and a policy prohibiting discriminatory use of protected attributes.

The target is cancellation within 30 days. The unit is the account-month. Candidate features include recent usage trend, payment history, service incidents, contract tenure, and prior support contacts. A cancellation request recorded after the scoring date must not be used as a feature.

Analysis and approach

The team first creates a time-based split: January–September for development, October for validation, and November for final testing. A rule-based baseline flags accounts with two missed payments. Logistic regression provides an interpretable benchmark; gradient-boosted trees provide a flexible comparison. Because outreach capacity is fixed, the primary evaluation uses precision among the top 8,000 accounts, recall, expected net benefit, and calibration.

The team discovers that a “disconnection workflow initiated” field produces exceptional validation performance. Investigation shows that the field is entered only after a customer has already requested cancellation. It is removed as leakage. The model is recalibrated, and its ranking performance falls but becomes operationally credible.

A pilot then randomises eligible high-risk accounts into outreach and no-outreach groups. This is essential because a high churn probability does not establish that outreach will prevent churn. The pilot estimates incremental retention and net financial value. Monitoring shows that performance is lower for accounts with sparse digital activity, so the team investigates whether the model is relying on unequal measurement rather than simply changing the threshold.

Outcome and learning points

The final system is used as a decision-support ranking tool rather than an automatic discount engine. Its value is assessed by incremental retained margin after contact costs, discounts, and service capacity. The case demonstrates that problem definition, leakage control, capacity-aware metrics, experimentation, calibration, and governance are as important as algorithm selection.

7. Limitations, Ethics, and Governance

Machine learning can reproduce historical discrimination, amplify unequal access, and create opaque decisions. Fairness is not a single universal metric. Depending on context, analysts may examine selection-rate differences, false-positive and false-negative rates, calibration, or equal opportunity. Some fairness criteria cannot all be satisfied simultaneously when groups have different base rates, so the relevant objective must be justified with stakeholders and legal advice.

Privacy requires purpose limitation, data minimisation, secure processing, retention controls, and appropriate access. Sensitive attributes may be prohibited as predictors yet still be needed for auditing disparities, subject to lawful and ethical safeguards. Explainability should match the decision: global feature understanding, local explanations, reason codes, counterfactual explanations, or model documentation may each be appropriate. An explanation is not automatically a causal account.

Governance should establish ownership, approval thresholds, documentation, incident response, human oversight, and review of material model changes. High-impact applications may require additional controls under applicable data-protection, anti-discrimination, consumer-protection, financial, employment, or sector-specific regulation. Analysts must distinguish statistical association from legally or scientifically defensible justification.

8. Contemporary Practice and Best Practices

Modern analytics increasingly combines tabular models with language, image, and time-series systems; uses automated feature and hyperparameter search; and deploys models through reproducible machine-learning operations (MLOps). These developments increase capability but also increase dependency on data quality, documentation, infrastructure, and monitoring.

Best practice includes:

  • Begin with a decision and intervention, not an algorithm.
  • Define time, unit, label, and information availability explicitly.
  • Establish a transparent baseline.
  • Use validation designs that mirror deployment.
  • Prevent leakage through feature lineage and cutoff rules.
  • Select metrics based on costs, capacity, and consequences.
  • Test calibration, subgroup performance, and temporal stability.
  • Prefer the simplest model that meets the operational objective.
  • Separate predictive claims from causal claims.
  • Document assumptions, limitations, version history, and ownership.
  • Monitor the deployed system and provide a retirement or rollback plan.

Chapter Summary

Machine learning learns patterns from data to support prediction, description, or sequential decision-making. Core concepts include observations, features, targets, parameters, hyperparameters, loss functions, generalisation, training, validation, testing, and leakage. Supervised learning uses known targets; unsupervised learning discovers structure; semi-supervised, self-supervised, and reinforcement approaches address different forms of available feedback.

Business value depends on translating a broad objective into a precise decision problem with a defined unit, timing, target, intervention, metric, and constraint. Predictive association does not establish causation, and a risk score does not identify who will benefit from treatment. Bias–variance reasoning explains why models that are too simple underfit and models that are too flexible overfit. A sound workflow combines data and model development with temporal validation, decision-aware evaluation, monitoring, ethical safeguards, and accountable governance.

Key Terms

Machine learning: Methods that learn patterns or decision rules from data.

Observation: The entity, event, or period represented by one analytical record.

Feature: An input variable used by a model.

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

Parameter: A value learned from training data.

Hyperparameter: A configuration chosen outside the ordinary parameter-learning process.

Loss function: A function measuring disagreement between predictions and observed outcomes during training.

Generalisation: Performance on relevant unseen data.

Overfitting: Learning sample-specific noise or peculiarities that reduce future performance.

Underfitting: Failing to capture useful structure because the model is too restrictive.

Data leakage: Use of information unavailable at prediction time.

Supervised learning: Learning from inputs paired with known targets.

Unsupervised learning: Learning structure without supplied targets.

Classification: Prediction of a categorical outcome.

Regression: Prediction of a numerical outcome.

Calibration: Agreement between predicted probabilities and observed frequencies.

Bias: Systematic error from restrictive assumptions or misspecification.

Variance: Sensitivity of a model to the particular training sample.

Causal inference: Estimation of effects of interventions or treatments.

Model drift: Change in data relationships or model performance after deployment.

Review Questions

Short Answer Questions

  1. Distinguish a feature from a target in a supervised-learning dataset.
  2. Why is a test set held back until model development is substantially complete?
  3. Explain one difference between prediction and causal inference.
  4. What is data leakage? Give one business example.
  5. Why can accuracy be misleading for a rare-event classification problem?

Long Answer Questions

  1. Explain the major machine-learning paradigms and compare their training signals, applications, and limitations.
  2. Describe an end-to-end machine-learning workflow for a business analytics project, including validation and monitoring.
  3. Explain the bias–variance trade-off, underfitting, overfitting, and the role of regularisation.
  4. Discuss how a broad business objective should be translated into a measurable analytics problem.
  5. Analyse the ethical, privacy, fairness, and governance issues that arise when a predictive model is deployed in a high-impact business process.

Analytical / Application Questions

  1. A bank wants to “reduce loan defaults.” Formulate a prediction problem by specifying the unit, index date, outcome horizon, candidate action, target, and at least two appropriate evaluation metrics.
  2. A fraud model identifies 90% of confirmed fraud but generates many false alerts. Explain which additional information and metrics you would use to decide whether deployment is worthwhile.
  3. A retention model ranks customers by cancellation risk, and management wants to offer discounts to the top-ranked customers. Explain why risk prediction alone is insufficient and design an experiment or analysis to estimate incremental retention and financial value.

Multiple Choice Questions with Answers

Question 1

Which statement best describes supervised learning?

A. It learns from inputs paired with known target outcomes.

B. It always learns through physical interaction with an environment.

C. It discovers structure without any input variables.

D. It uses only manually coded business rules.

Correct Answer: A. It learns from inputs paired with known target outcomes.

Question 2

A model uses a customer’s cancellation request, entered after the prediction date, to predict cancellation. What problem does this create?

A. Underfitting

B. Data leakage

C. Class balancing

D. Regularisation

Correct Answer: B. Data leakage

Question 3

Which question is primarily causal?

A. Which customers are most likely to churn?

B. How many customers churned last quarter?

C. Would a retention offer reduce churn among eligible customers?

D. Which customers have similar purchase histories?

Correct Answer: C. Would a retention offer reduce churn among eligible customers?

Question 4

In binary classification, recall is calculated as:

A. TP ÷ (TP + FP)

B. TP ÷ (TP + FN)

C. (TP + TN) ÷ total observations

D. FP ÷ (FP + TN)

Correct Answer: B. TP ÷ (TP + FN)

Question 5

What is the principal purpose of a validation set?

A. To replace the training data

B. To tune models and select among alternatives

C. To guarantee causal identification

D. To remove all measurement error

Correct Answer: B. To tune models and select among alternatives

Question 6

Which split is generally most appropriate for evaluating a model that forecasts future demand?

A. A random split that mixes all dates

B. A split based on customer name

C. A time-based split with later periods held out

D. A split containing only high-demand observations

Correct Answer: C. A time-based split with later periods held out

Question 7

In the bias–variance framework, a highly flexible model that fits training data extremely closely is at increased risk of:

A. Overfitting

B. Under-sampling by definition

C. Improved causal validity

D. Eliminating irreducible noise

Correct Answer: A. Overfitting

Question 8

Which metric is expressed in the same units as a numerical target?

A. Mean absolute error

B. Squared error without a square root

C. Classification recall

D. Precision

Correct Answer: A. Mean absolute error

Question 9

A churn score identifies customers likely to cancel. What additional evidence is needed to determine whom to offer an incentive to?

A. Only a higher model complexity

B. An estimate of treatment or intervention effect

C. Removal of the target variable

D. A random change to the classification threshold

Correct Answer: B. An estimate of treatment or intervention effect

Question 10

Why should a business establish a simple baseline model?

A. To ensure complex models are always rejected

B. To provide a transparent benchmark for incremental value

C. To eliminate the need for a test set

D. To make all predictions causal

Correct Answer: B. To provide a transparent benchmark for incremental value

Machine Learning Algorithms
Chapter 1 of 15