Predictive Analytics

Chapter 3
Statistical Learning Foundations

Bachelors Program in Business Analytics
Predictive Analytics   •   Bachelor

Statistical Learning Foundations

Introduction

Predictive analytics uses data to estimate unknown outcomes or future events. Its practical success depends not only on algorithms, but also on sound statistical reasoning. A predictive model is learned from a sample, evaluated on observations that represent its intended use, and judged by a loss function that reflects the consequences of errors. Probability provides the language of uncertainty; sampling determines what the data represent; correlation describes association; statistical inference quantifies uncertainty; and learning theory explains why a model may perform well on training data but poorly on new cases.

This chapter develops the foundations required to build and assess predictive models responsibly. The emphasis is on business applications such as credit risk, customer retention, demand forecasting and fraud detection.

Learning Objectives

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

  1. Explain probability concepts used in predictive analytics.
  2. Distinguish populations, samples, parameters and statistics.
  3. Describe sampling methods and sources of sampling bias.
  4. Interpret covariance and correlation without confusing association with causation.
  5. Construct and interpret confidence intervals and hypothesis tests.
  6. Select suitable loss functions for regression and classification.
  7. Explain generalization, underfitting, overfitting and the bias–variance trade-off.
  8. Identify assumptions underlying common predictive models.
  9. Apply these ideas to evaluate a business prediction problem.

1. Probability as the Language of Prediction

A probability model represents uncertainty about an outcome. An experiment has a sample space, denoted Ω, containing all possible outcomes. An event A is a subset of Ω. Its probability P(A) satisfies 0 ≤ P(A) ≤ 1, with P(Ω) = 1.

For mutually exclusive events A and B,

P(A ∪ B) = P(A) + P(B)

For general events,

P(A ∪ B) = P(A) + P(B) − P(A ∩ B)

Here, ∪ means “A or B,” and ∩ means “A and B.” The subtraction prevents the intersection from being counted twice.

The conditional probability of A given B is:

P(A | B) = P(A ∩ B) / P(B), provided P(B) > 0

The multiplication rule follows:

P(A ∩ B) = P(A | B)P(B)

Two events are independent when knowledge of one does not change the probability of the other: P(A | B) = P(A). Independence implies P(A ∩ B) = P(A)P(B), but events that are merely uncorrelated are not necessarily independent.

Bayes’ theorem

Bayes’ theorem updates a prior probability using observed evidence:

P(A | B) = P(B | A)P(A) / P(B)

In predictive analytics, A may represent a condition such as default, while B may represent evidence such as a low credit score. P(A) is the prior probability, P(B | A) is the likelihood, and P(A | B) is the posterior probability.

For several mutually exclusive and exhaustive hypotheses A₁, …, Aₖ,

P(Aj | B) = P(B | Aj)P(Aj) / ∑i=1k P(B | Ai)P(Ai)

The denominator ensures that posterior probabilities sum to one.

Random variables and distributions

A random variable maps outcomes to numerical values. A discrete random variable takes countable values; a continuous random variable takes values over intervals. Its expected value is the probability-weighted long-run average:

E[X] = ∑ x xP(X = x) (discrete case)

For a continuous variable with density f(x),

E[X] = ∫ x f(x) dx

Variance measures dispersion around the mean μ = E[X]:

Var(X) = E[(X − μ)²]

The standard deviation is σ = √Var(X), measured in the same units as X. Variance is measured in squared units.

A frequently used model is the normal distribution, written X ~ N(μ, σ²). It is symmetric around μ and is determined by its mean and variance. Normality is useful in some inference procedures, but many predictive algorithms do not require the target or predictors to be normally distributed.

2. Populations, Samples and Sampling

A population is the complete set of units about which a conclusion is intended. A sample is the observed subset used for analysis. A population parameter, such as the true mean μ, is fixed but usually unknown. A sample statistic, such as the sample mean x̄, is calculated from observed data and varies from sample to sample.

The sample mean for n observations x₁, …, xₙ is:

x̄ = (1/n)∑i=1n xi

The commonly used unbiased sample variance is:

s² = [1/(n − 1)]∑i=1n (xi − x̄)²

The n − 1 denominator corrects for the fact that x̄ is estimated from the same data. The correction is relevant when estimating a population variance from a sample; it is not a universal requirement for every variance calculation.

Sampling methods

  • Simple random sampling: every population unit has a known and equal selection probability.
  • Stratified sampling: the population is divided into meaningful groups, or strata, and units are sampled within each group. This can improve representation of small but important groups.
  • Cluster sampling: naturally occurring groups are sampled, and units within selected clusters are observed. It can reduce cost but may increase sampling variability.
  • Systematic sampling: every kth unit is selected after a random starting point.
  • Convenience sampling: units are selected because they are easy to access. It is inexpensive but often poorly representative.

Sampling error is random variation caused by observing a sample rather than the whole population. Sampling bias is systematic distortion caused by the selection process or by missing observations. Examples include undercoverage, nonresponse, survivorship bias and selection based on the outcome.

A predictive model can be statistically sophisticated yet operationally invalid if its training sample does not represent the population at prediction time. Data leakage is a related problem: information unavailable when a prediction is made is inadvertently included during training.

Sampling distributions and the central limit theorem

The sampling distribution of a statistic is the distribution it would have across repeated samples. Under suitable regularity conditions, especially independence and finite variance, the central limit theorem states that the standardized sample mean becomes approximately normal as n increases:

(x̄ − μ)/(σ/√n) ≈ N(0, 1)

The approximation may be poor for small samples, strong dependence or extremely heavy-tailed data. The standard error of x̄ is σ/√n, or is estimated by s/√n when σ is unknown. Increasing sample size reduces standard error at a rate proportional to 1/√n; quadrupling the sample size approximately halves it.

3. Association: Covariance and Correlation

Covariance indicates whether two variables tend to be above or below their means together. The sample covariance is:

sxy = [1/(n − 1)]∑i=1n (xi − x̄)(yi − ȳ)

Its units are the product of the units of X and Y, so its magnitude is difficult to compare across variable pairs. Pearson’s sample correlation standardizes covariance:

r = sxy/(sx sy)

where s_x and s_y are sample standard deviations. Equivalently,

r = ∑(xi − x̄)(yi − ȳ) / √[∑(xi − x̄)² ∑(yi − ȳ)²]

When both standard deviations are positive, −1 ≤ r ≤ 1. A positive value indicates a positive linear association; a negative value indicates a negative linear association; a value near zero indicates little linear association. Correlation is unit-free and symmetric: corr(X,Y) = corr(Y,X).

Correlation does not establish causation. A third variable may create a spurious association, reverse causality may operate, or the relationship may be nonlinear. Outliers can substantially alter r. A scatterplot, subgroup analysis and domain knowledge should accompany correlation analysis.

A correlation of zero does not rule out a nonlinear relationship. For example, if Y = X² and X is symmetrically distributed around zero, the linear correlation may be zero even though Y is completely determined by X.

4. Statistical Inference

Statistical inference uses sample data to learn about a population while acknowledging uncertainty.

Confidence intervals

A 95% confidence interval for a population mean, when a normal approximation is justified, is commonly written:

x̄ ± z0.975(σ/√n)

where z₀.₉₇₅ ≈ 1.96 is the 97.5th percentile of the standard normal distribution. If σ is unknown and the sample is reasonably compatible with a normal model, a t critical value is used:

x̄ ± t0.975,n−1(s/√n)

The confidence level describes the long-run performance of the interval-producing procedure: across repeated samples, approximately 95% of such intervals would contain μ. It does not mean that there is a 95% probability that a fixed μ lies in this already calculated interval under the frequentist interpretation.

Worked example: mean delivery time

Suppose a random sample of n = 64 deliveries has mean time x̄ = 42 minutes and known population standard deviation σ = 8 minutes. A 95% interval is:

42 ± 1.96(8/√64) = 42 ± 1.96(1) = [40.04, 43.96] minutes

The interval estimates the population mean under the assumptions of random, independent sampling and a valid normal approximation. It does not assert that 95% of individual deliveries fall in this range; individual outcomes are more variable than the estimated mean.

Hypothesis testing

A hypothesis test compares a null hypothesis H₀ with an alternative H₁. A test statistic measures how far the observed result is from what H₀ predicts. The p-value is the probability, assuming H₀ is true, of observing a result at least as extreme as the one obtained, according to the specified test statistic.

A small p-value is evidence against H₀, not proof that H₁ is true. Statistical significance does not necessarily imply business significance. A tiny effect can be statistically significant in a very large sample, while an important effect can fail to reach significance in a small sample.

Type I error rejects a true null hypothesis; Type II error fails to reject a false null hypothesis. Statistical power is 1 − β, where β is the Type II error probability under a specified alternative. Power generally increases with sample size, effect size and measurement precision, and decreases with noise.

Multiple testing increases the chance of false discoveries. When many hypotheses are tested, analysts should pre-specify primary outcomes or control error rates using appropriate methods, such as family-wise error or false discovery rate procedures.

5. Loss Functions and Model Evaluation

A predictive model maps features X to a prediction ŷ. A loss function L(y, ŷ) quantifies the cost of predicting ŷ when the actual outcome is y. The empirical risk is the average loss on observed data:

R̂(f) = (1/n)∑i=1n L(yi, f(xi))

Here f is a prediction rule, n is the number of observations, and R̂(f) is measured in the units of the chosen loss.

Regression losses

Squared-error loss is:

L(y, ŷ) = (y − ŷ)²

Its empirical form is mean squared error (MSE):

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

MSE strongly penalizes large errors and is differentiable, which is useful for optimization. Its square root, RMSE = √MSE, has the same units as the target.

Absolute-error loss is:

L(y, ŷ) = |y − ŷ|

Mean absolute error (MAE) is more resistant to extreme errors than MSE. Under absolute loss, the population-optimal constant prediction is a median; under squared loss, it is a mean.

Quantile loss supports asymmetric costs. For quantile level 0 < τ < 1:

L_τ(y, ŷ) = τ(y − ŷ) if y ≥ ŷ
(τ − 1)(y − ŷ) if y < ŷ

This loss is useful when underprediction and overprediction have different consequences, such as inventory planning.

Classification losses

For a binary outcome y ∈ {0,1}, a classifier may output a class or a probability p̂ = P(Y = 1 | X).

Zero–one loss is 0 for a correct class and 1 otherwise. It is intuitive but discontinuous and does not reward calibrated probabilities.

Log loss for a binary outcome is:

L(y, p̂) = −[y ln(p̂) + (1 − y)ln(1 − p̂)]

where 0 < p̂ < 1. Log loss heavily penalizes confident incorrect predictions and is appropriate when probability quality matters. For multiclass outcomes, it is the negative logarithm of the probability assigned to the true class.

A confusion matrix reports true positives, true negatives, false positives and false negatives. Important metrics include:

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

Accuracy can be misleading with imbalanced classes. The metric and classification threshold should reflect business costs. For example, missing a fraudulent transaction may be more costly than investigating a legitimate transaction.

6. Generalization and the Bias–Variance Trade-off

Training error measures performance on the data used to fit a model. Generalization error measures expected performance on new observations drawn from the target data-generating process. Predictive analytics is primarily concerned with generalization.

A standard workflow divides data into training, validation and test sets. The training set estimates model parameters. The validation set supports model or hyperparameter selection. The test set is used once, after decisions are finalized, to provide an approximately unbiased estimate of performance. Cross-validation repeatedly partitions the training data to estimate validation performance and is especially useful when data are limited. Time-ordered data require time-aware splits rather than random shuffling when future information must not influence the past.

Underfitting and overfitting

Underfitting occurs when a model is too simple to capture important structure. It usually has high training error and high test error. Overfitting occurs when a model learns noise or idiosyncrasies of the training sample. It may have very low training error but high test error.

Model complexity includes not only the number of variables, but also flexibility, interactions, tree depth, neural-network capacity and the extent of hyperparameter search. Regularization, early stopping, feature selection and more data can reduce overfitting.

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

Expected test error = noise variance + bias² + variance

Bias is systematic error from restrictive assumptions. Variance is sensitivity to the particular training sample. Noise, sometimes called irreducible error, is uncertainty in outcomes that the available features cannot predict. The decomposition is an idealized expectation under specified assumptions, not a direct accounting identity for every fitted model.

A highly flexible model often has low bias and high variance; a rigid model often has high bias and low variance. The goal is not to minimize training error at any cost, but to choose a complexity level that minimizes expected error on new cases.

7. Assumptions Underlying Predictive Models

Assumptions are conditions that justify interpretation, estimation or uncertainty calculations. They differ across methods.

Linear regression

A linear regression model can be written:

yi = β₀ + β₁xi1 + … + βpxip + εi

where y_i is the response, x_{ij} are predictors, β coefficients are fixed unknown parameters, and ε_i is an error term. Common assumptions include:

  • linearity of the conditional mean;
  • independent observations or appropriately modeled dependence;
  • no perfect multicollinearity among predictors;
  • mean-zero errors conditional on predictors, E(ε_i | X_i) = 0;
  • constant conditional variance for standard ordinary least-squares inference;
  • approximately normal errors mainly when small-sample t and F procedures are used.

Normality of errors is not required for least-squares predictions to exist, and heteroscedasticity does not automatically invalidate predictions, but both can affect standard errors, intervals and interpretation.

Logistic regression

For binary outcomes, logistic regression models log odds:

ln[p(x)/(1 − p(x))] = β₀ + β₁x₁ + … + βpxp

where p(x) = P(Y = 1 | X = x). The model assumes a linear relationship between predictors and log odds, independent observations unless dependence is modeled, and no complete or problematic separation. It does not assume that the binary outcome itself is normally distributed.

Tree-based and other flexible models

Decision trees make fewer distributional assumptions, but they remain vulnerable to overfitting, sampling instability and biased evaluation. Nearest-neighbor methods are sensitive to feature scales and irrelevant variables. Neural networks require choices about architecture, optimization and regularization. Every method still depends on representative data, appropriate target definition and valid evaluation.

Assumptions should be checked using residual plots, calibration plots, subgroup evaluation, domain knowledge and sensitivity analyses. A model can have good average accuracy while violating fairness or failing badly for a critical subgroup.

8. Illustrative Case: Predicting Customer Churn

Background

A subscription company wants to identify customers likely to cancel within the next 30 days so that retention teams can contact them. This is an illustrative case rather than a report of a specific company.

Problem

The company has transaction history, tenure, service usage, complaint records and customer-support contacts. The target is churn within 30 days. The business cost of missing a likely churner is estimated at $120 in lost contribution margin. Contacting a customer costs $8 and may create annoyance if the customer would not have churned.

Analysis

The analyst first defines the prediction time. Only information available at that time may be used. A random split would be inappropriate if the company’s behavior and customer mix change over time; a chronological training, validation and test split is safer. Churn prevalence is 8%, so accuracy alone is unsuitable: a model predicting “no churn” for everyone would be 92% accurate but operationally useless.

The team examines missingness, duplicate accounts, class balance and potential leakage. For example, a cancellation-confirmation field must not be used as a predictor because it becomes available after the event is effectively known. Correlations among usage variables are reviewed, but no correlation is interpreted as proof of causation.

The team compares logistic regression with a regularized tree-based model. Logistic regression offers transparent coefficients and a baseline. The tree model captures nonlinear relationships but requires validation of depth and minimum leaf size. Because contact costs and missed-churn costs differ, the classification threshold is selected using expected business cost rather than a default threshold of 0.5.

If C_FN is the cost of a false negative and C_FP is the cost of a false positive, an estimated cost for a threshold is:

Total estimated cost = CFN × FN + CFP × FP

This simple expression assumes costs are appropriately specified and that each error has the same cost within its category. In practice, customer value and intervention response may require more detailed decision analysis.

Approach and outcome

Suppose validation shows that the regularized model has lower log loss and better recall at the contact capacity available to the retention team. The final model is retrained using training and validation data, evaluated once on the untouched test period, and monitored after deployment. Calibration is checked so that predicted probabilities correspond reasonably to observed churn rates. Performance is reported overall and by tenure, geography and service plan.

The outcome is not merely a list of “at-risk” customers. It is a controlled decision process: rank customers by expected value, contact only those for whom intervention is worthwhile, record outcomes, and periodically reassess drift. A randomized holdout group can estimate whether contacting predicted churners actually reduces churn. Prediction alone does not demonstrate that an intervention causes retention.

Learning points

  1. Define the prediction moment before selecting features.
  2. Use time-aware evaluation when future data must remain unseen.
  3. Match the loss function and threshold to business consequences.
  4. Use probability calibration when decisions depend on risk estimates.
  5. Evaluate fairness, subgroup performance and intervention effects.
  6. Monitor drift because customer behavior and operational processes change.

9. Professional, Ethical and Governance Considerations

Predictive models can affect access to credit, insurance, employment, healthcare and prices. Analysts should document the target, data sources, feature availability, sampling process, evaluation design and known limitations. Personal data should be collected and used for legitimate purposes, minimized where possible, protected from unauthorized access and retained only as needed under applicable law and organizational policy.

Fairness cannot be inferred from a single metric. Analysts should examine error rates, calibration and selection rates across relevant groups, recognizing that different fairness criteria may conflict, especially when base rates differ. Sensitive attributes may be needed for auditing even when they are excluded from prediction, subject to legal and governance requirements.

Reproducibility requires versioned data definitions, code, model artifacts and random seeds where appropriate. Human oversight is necessary when predictions have significant consequences. A model’s confidence, uncertainty and appropriate use should be communicated to decision-makers rather than hidden behind a single score.

Contemporary practice increasingly combines statistical learning with explainability tools, automated monitoring and responsible-AI controls. These tools support investigation but do not replace causal reasoning, domain expertise or accountability.

Best Practices

  • Define the population, outcome and prediction horizon explicitly.
  • Separate training, validation and final test information.
  • Prevent leakage by reproducing the information available at decision time.
  • Select metrics and losses that reflect actual costs.
  • Inspect distributions, missingness, outliers and subgroup performance.
  • Compare against a simple baseline.
  • Use cross-validation or time-aware validation appropriately.
  • Report uncertainty and avoid overstating statistical significance.
  • Check calibration when predicted probabilities guide action.
  • Monitor drift, fairness and performance after deployment.

Chapter Summary

Probability provides the formal language for uncertain outcomes, including conditional probability and Bayes’ theorem. Sampling connects observed data to a target population, but biased or leaky samples can invalidate even technically strong models. Covariance and correlation measure association; neither alone establishes causation, and correlation may miss nonlinear relationships.

Statistical inference uses sampling distributions, confidence intervals and hypothesis tests to quantify uncertainty. Interpretation must distinguish statistical significance from practical importance and account for multiple testing. Loss functions define what prediction error means: squared and absolute losses serve different regression purposes, while classification metrics and log loss reflect different operational needs.

Generalization is performance on new data, not merely training accuracy. Underfitting reflects excessive simplicity; overfitting reflects excessive sensitivity to training noise. The bias–variance perspective explains why model complexity must be controlled. Finally, all predictive models depend on assumptions about data, dependence, measurement and deployment context. Responsible practice therefore combines statistical theory, careful validation, business judgment, ethical governance and continuous monitoring.

Key Terms

Probability: Numerical representation of uncertainty about an event.

Conditional probability: Probability of an event given that another event is known.

Bayes’ theorem: Rule for updating a probability using evidence.

Random variable: Numerical function of a random outcome.

Expected value: Probability-weighted average of a random variable.

Variance: Expected squared deviation from the mean.

Population: Complete set of units targeted by an analysis.

Sample: Observed subset of a population.

Parameter: Fixed but usually unknown population quantity.

Statistic: Quantity calculated from sample data.

Sampling bias: Systematic distortion caused by the sampling process.

Data leakage: Use of information unavailable at prediction time.

Covariance: Directional joint variation of two variables.

Correlation: Standardized measure of linear association.

Confidence interval: Interval produced by a procedure with stated long-run coverage.

p-value: Probability, under the null hypothesis, of a result at least as extreme as observed.

Loss function: Numerical cost assigned to a prediction error.

Generalization: Performance of a model on new observations.

Overfitting: Learning sample-specific noise rather than transferable structure.

Calibration: Agreement between predicted probabilities and observed frequencies.

Review Questions

Short Answer Questions

  1. Distinguish a population parameter from a sample statistic.
  2. State Bayes’ theorem and explain the roles of prior and likelihood.
  3. Why does correlation not establish causation?
  4. What is the difference between a confidence interval and a prediction interval?
  5. Why can accuracy be misleading for an imbalanced classification problem?

Long Answer Questions

  1. Explain how sampling bias and data leakage can each damage predictive-model validity. Give an example of each.
  2. Compare squared-error loss, absolute-error loss and quantile loss in a business forecasting context.
  3. Explain underfitting, overfitting and the bias–variance trade-off, including methods for controlling overfitting.
  4. Describe the assumptions of linear regression and explain which assumptions primarily affect prediction and which affect statistical inference.
  5. Design an evaluation procedure for a churn model whose data are collected over time and whose false-negative cost is greater than its false-positive cost.

Analytical / Application Questions

  1. A fraud model has 2,000 predictions: TP = 90, FP = 110, TN = 1,750 and FN = 50. Calculate precision, recall and accuracy. Which metric would be especially important if missed fraud is very costly?
  2. A retailer must choose between two demand models. Model A has lower training MSE but higher validation MSE than Model B. Diagnose the likely issue and recommend a next step.
  3. A customer-risk model produces probabilities of 0.80 for many customers, but only 0.55 of those customers actually default. What does this indicate about calibration, and what business risks could result?

Multiple Choice Questions with Answers

Question 1

If P(A) = 0.2 and P(B | A) = 0.5, what is P(A ∩ B)?

A. 0.10

B. 0.25

C. 0.40

D. 0.70

Correct Answer: A. 0.10

Question 2

Which sampling method deliberately ensures representation of specified subgroups?

A. Convenience sampling

B. Stratified sampling

C. Cluster sampling

D. Systematic sampling

Correct Answer: B. Stratified sampling

Question 3

A correlation close to zero most directly indicates:

A. No relationship of any kind

B. No causal relationship

C. Little linear association

D. Equal means

Correct Answer: C. Little linear association

Question 4

For n = 64 and known σ = 8, the standard error of the sample mean is:

A. 0.125

B. 1

C. 8

D. 64

Correct Answer: B. 1

Question 5

Which loss strongly penalizes large regression errors?

A. Absolute-error loss

B. Squared-error loss

C. Zero–one loss

D. Classification accuracy

Correct Answer: B. Squared-error loss

Question 6

A model with very low training error and much higher test error is most likely:

A. Underfitting

B. Overfitting

C. Unbiased by definition

D. Perfectly calibrated

Correct Answer: B. Overfitting

Question 7

Which statement about a 95% frequentist confidence interval is correct?

A. There is a 95% probability that the fixed parameter lies in this calculated interval.

B. 95% of individual observations must lie in the interval.

C. About 95% of intervals from repeated samples would contain the parameter.

D. The null hypothesis has a 95% probability of being true.

Correct Answer: C. About 95% of intervals from repeated samples would contain the parameter.

Question 8

For binary classification, log loss particularly penalizes:

A. Correct predictions with moderate probabilities

B. Confident incorrect predictions

C. All predictions equally

D. Only false positives

Correct Answer: B. Confident incorrect predictions

Question 9

Which practice best prevents temporal data leakage?

A. Randomly shuffle all observations before splitting

B. Use features recorded after the prediction event

C. Use chronological training and test periods

D. Evaluate only on training data

Correct Answer: C. Use chronological training and test periods

Question 10

Under squared-error loss, the best constant prediction for a population is its:

A. Mode

B. Median

C. Mean

D. Maximum

Correct Answer: C. Mean

Predictive Analytics
Chapter 3 of 15