Machine Learning for Business

Chapter 6
Regression and Business Prediction

Bachelors Program in Business Analytics
Machine Learning for Business   •   Bachelor

Regression and Business Prediction

Introduction

Regression is one of the most widely used approaches in business analytics because it connects measurable business drivers to a numerical outcome. Organizations use regression to estimate demand, predict revenue, evaluate pricing decisions, forecast customer value, assess operational performance, and quantify relationships that support managerial decisions.

A regression model does not merely produce a prediction. It also provides an interpretable representation of how an outcome is associated with one or more explanatory variables. This makes regression especially valuable in business settings, where decision makers often need to understand both what is likely to happen and why.

Regression is not synonymous with causation. A strong predictive relationship may arise because a variable is a proxy for another factor, because both variables respond to a common cause, or because the data contain selection bias. Sound regression practice therefore combines statistical modelling, diagnostic analysis, domain knowledge, validation, and ethical judgment.

Learning Objectives

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

  1. Explain the purpose and structure of regression models.
  2. Estimate and interpret simple and multiple linear regression.
  3. Distinguish prediction, association, and causation.
  4. Use polynomial terms to represent non-linear relationships.
  5. Explain and apply ridge and lasso regularization.
  6. Diagnose assumptions using residuals and validation measures.
  7. Apply regression to pricing, demand, revenue, customer value, and operations.
  8. Identify limitations, governance risks, and appropriate business uses of regression.

1. The Regression Framework

Let y denote a numerical response variable and let x1, x2, ..., xp denote predictor variables. A general regression model describes the conditional mean of the response:

E(y | x1, x2, ..., xp) = f(x1, x2, ..., xp)

Here, E(y | x1, ..., xp) is the expected value of y for observations with specified predictor values, and f is a function estimated from data. The function may be linear, polynomial, or another structured form.

A prediction is an estimated outcome for a particular case. An estimated coefficient describes the fitted relationship between a predictor and the response, conditional on the other predictors in the model. These are different purposes: a model can predict accurately without producing simple or causally meaningful coefficients.

Population model and sample model

The population relationship is usually represented as:

yi = β0 + β1xi1 + β2xi2 + ... + βpxip + εi

The fitted sample model is:

ŷi = b0 + b1xi1 + b2xi2 + ... + bpxip

where:

SymbolMeaning
yiObserved response for observation i
ŷiPredicted response
β0Population intercept
βjPopulation coefficient for predictor j
b0, bjEstimated sample coefficients
εiRandom error or unexplained component
pNumber of predictors

The error term represents influences not included in the model, measurement error, and random variation. The fitted residual is:

ei = yi - ŷi

Residuals are central to model diagnosis.

2. Simple and Multiple Linear Regression

Simple linear regression

Simple linear regression contains one predictor:

yi = β0 + β1xi + εi

The slope β1 is the expected change in y associated with a one-unit increase in x, under the model assumptions. The intercept β0 is the expected value of y when x = 0. The intercept may have little practical meaning if zero is outside the observed range.

For example, suppose a fitted model predicts weekly sales revenue in thousands of dollars from digital advertising expenditure in thousands of dollars:

ŷ = 42 + 3.6x

The slope indicates that an additional $1,000 of advertising expenditure is associated with an estimated $3,600 increase in weekly revenue, within the range represented by the data. For an advertising expenditure of $10,000, predicted revenue is:

ŷ = 42 + 3.6(10) = 78

Thus, the prediction is $78,000. This is an association, not automatically a causal return on advertising, because other factors may influence both advertising and revenue.

Multiple linear regression

Multiple regression extends the model to several predictors:

yi = β0 + β1xi1 + β2xi2 + ... + βpxip + εi

The coefficient βj is interpreted as the expected difference in y for a one-unit increase in xj, holding the other included predictors constant. This conditional interpretation is useful but does not eliminate confounding or guarantee causal validity.

For a demand model such as:

ŷ = 1,200 - 18P + 0.04A + 90W

where P is price in dollars, A is advertising expenditure in dollars, and W is a promotional-week indicator, the coefficient −18 means that a one-dollar increase in price is associated with 18 fewer units of demand, conditional on advertising and promotional status. The coefficient 90 means that promotional weeks are associated with 90 additional units, holding price and advertising constant.

Least squares estimation

Ordinary least squares (OLS) chooses coefficients that minimize the sum of squared residuals:

SSE = ∑i=1n(yi - ŷi)2

where n is the number of observations. Squaring prevents positive and negative errors from cancelling and gives greater weight to large errors. OLS is appropriate when the linear conditional-mean structure is reasonable and extreme observations do not dominate the fit.

For a simple regression, the slope estimate can be written as:

b1 = ∑(xi - x̄)(yi - ȳ) ÷ ∑(xi - x̄)2

and the intercept is:

b0 = ȳ - b1x̄

Here, x̄ and ȳ are sample means. The formula requires variation in x; if every predictor value is identical, the slope cannot be estimated.

3. Measuring Model Performance

Mean squared error and root mean squared error

The mean squared error is:

MSE = (1 ÷ n)∑i=1n(yi - ŷi)2

The root mean squared error is:

RMSE = √MSE

RMSE is expressed in the same units as the response. If revenue is measured in dollars, RMSE is measured in dollars. Because errors are squared, RMSE is sensitive to large mistakes.

Mean absolute error

MAE = (1 ÷ n)∑i=1n|yi - ŷi|

MAE is also expressed in response units and is easier to interpret as an average absolute error. It is less sensitive to extreme errors than RMSE.

Coefficient of determination

For a model with an intercept, the coefficient of determination is:

R² = 1 - SSE ÷ SST

where:

SST = ∑i=1n(yi - ȳ)2

SST is the total sum of squares. R² represents the proportion of sample variation around the mean that is reduced by the fitted model. It does not measure the proportion of individual predictions that are correct, and a high R² does not establish causality.

Adjusted R² penalizes the addition of predictors that contribute little explanatory value:

Adjusted R² = 1 - [(1 - R²)(n - 1) ÷ (n - p - 1)]

This expression assumes a model with an intercept and n > p + 1. Performance should ultimately be assessed on data not used to fit the model.

Training, validation, and test data

A training set estimates model parameters. A validation set supports model selection and tuning. A test set provides a final, approximately unbiased assessment when it has not influenced modelling decisions. For time-dependent business data, random splitting may leak future information into the past; chronological splitting is usually more appropriate.

Cross-validation repeatedly fits a model on subsets of the training data and evaluates it on held-out folds. For a time series, folds should preserve temporal order. The goal is to estimate out-of-sample performance, not to guarantee future accuracy.

4. Assumptions and Diagnostics

Regression assumptions concern the data-generating process and the appropriateness of the model, not whether the dataset looks tidy.

Linearity of the conditional mean

The expected response should be adequately represented by the selected functional form. A curved residual-versus-fitted plot suggests omitted non-linearity, such as saturation or a threshold.

Independence

Observations or errors should be independent for standard uncertainty calculations. Repeated observations from the same customer, store, employee, or time period may be correlated. Clustered or panel data require suitable methods, such as grouped standard errors or hierarchical models.

Constant variance

Homoscedasticity means that the conditional variance of errors is approximately constant:

Var(ε | X) = σ²

If variability increases with predicted sales, the model is heteroscedastic. Coefficient estimates may remain useful under some conditions, but conventional standard errors and prediction intervals can be unreliable. Transformations, weighted least squares, or robust standard errors may help.

Normality of errors

Normal errors are not required for producing point predictions with OLS. Approximate normality is more relevant to small-sample hypothesis tests and confidence intervals. A Q–Q plot can reveal skewness or heavy tails.

Multicollinearity

Multicollinearity occurs when predictors contain overlapping information. It can produce unstable coefficients and large standard errors even when predictions are adequate. Correlation matrices, variance inflation factors, domain review, and coefficient stability across samples are useful diagnostics. Removing a variable solely because of correlation may damage the model if that variable is operationally important.

Outliers and influential observations

An outlier has an unusual response or predictor value. A high-leverage observation has an unusual predictor combination. An influential observation substantially changes fitted coefficients when removed. Analysts should investigate whether such records represent errors, rare but valid cases, structural changes, or important business segments. Automatic deletion is inappropriate.

5. Non-Linear Relationships and Polynomial Regression

A relationship may be non-linear even when the response is continuous. Polynomial regression introduces powers of a predictor while remaining linear in its coefficients:

yi = β0 + β1xi + β2xi² + ... + βkxik + εi

The model is called linear regression because it is linear in β0, ..., βk, not because its graph must be a straight line.

For a quadratic model:

ŷ = b0 + b1x + b2x²

The marginal effect of x is:

dŷ ÷ dx = b1 + 2b2x

Thus, the effect changes with the level of x. If b2 < 0, the curve is concave and has a maximum at:

x* = -b1 ÷ (2b2)

This turning-point calculation is meaningful only if the value lies within a credible observed or operational range. High-degree polynomials can oscillate and extrapolate poorly. Centering or scaling x before creating powers can improve numerical stability, although it does not change the underlying fitted curve when the model is specified equivalently.

Business examples include diminishing advertising returns, an inverted-U relationship between price and margin, and increasing delivery delays at high capacity utilization.

6. Regularization: Ridge and Lasso Regression

When predictors are numerous, correlated, or measured with noise, least squares may produce unstable coefficients. Regularization adds a penalty to the loss function.

Ridge regression

Ridge regression minimizes:

∑i=1n(yi - ŷi)2 + λ∑j=1pbj²

where λ ≥ 0 controls the penalty. The intercept is normally not penalized, and predictors should generally be standardized so that the penalty is comparable across units. Ridge shrinks coefficients toward zero but typically does not set them exactly to zero. It is useful when many predictors contribute small, overlapping signals.

Lasso regression

Lasso minimizes:

∑i=1n(yi - ŷi)2 + λ∑j=1p|bj|

The absolute-value penalty can set some coefficients exactly to zero, producing a sparse model. Lasso can therefore support feature selection, but with strongly correlated predictors it may select one variable somewhat arbitrarily. Selection should be validated and interpreted with domain knowledge.

As λ increases, both methods generally reduce coefficient magnitude and increase bias while reducing variance. The value of λ should be selected using validation or cross-validation, not by inspecting test performance repeatedly.

7. Business Applications

Pricing and demand

A demand model can estimate the relationship between price, promotions, seasonality, competitor prices, and demand. Price effects are often non-linear and may differ by customer segment. A simple regression coefficient should not be interpreted as a universal price elasticity unless the model and units support that interpretation.

Elasticity is the percentage change in quantity associated with a one-percent change in price. At a point on a demand curve:

Elasticity = (dQ ÷ dP) × (P ÷ Q)

where Q is demand and P is price. If a log-log model is used, the price coefficient is directly interpreted as an elasticity under the model specification. Demand models must account for promotions and inventory constraints, since observed sales may be limited by stock rather than customer demand.

Revenue and profitability

Revenue is often represented as price multiplied by quantity:

Revenue = Price × Quantity sold

A regression forecasting revenue can support budgeting, but revenue predictions should not be confused with profit predictions. Profit also depends on variable cost, fixed cost, discounts, returns, and capacity constraints.

Customer lifetime value

Customer value models may predict future margin, retention duration, or purchase frequency. A basic discounted value representation is:

CLV = ∑t=1T [(Expected revenuet - Expected costt) ÷ (1 + r)t]

where T is the forecast horizon and r is the discount rate per period. Regression may estimate expected revenue, cost, or retention inputs, but uncertainty compounds over a long horizon. Predictions should be used for prioritization rather than treated as certain individual outcomes.

Operational performance

Regression can estimate delivery time, call-handling time, energy consumption, defect rates, or staffing requirements. Operational models should include workload, staffing, process type, time of day, and equipment conditions. A model trained during normal operations may fail during disruptions, making monitoring and scenario analysis essential.

8. Illustrative Case: Predicting Retail Delivery Time

Background

A regional retailer offers home delivery from 18 stores. Managers want to predict delivery time so that customers receive realistic delivery windows and dispatchers can identify overloaded routes. This is an illustrative case, not a report of a real company.

Problem

Historical data include delivery time in minutes, route distance, number of packages, number of stops, weather category, day of week, and driver experience. The outcome is affected by operational decisions: dispatchers may assign difficult routes to experienced drivers, creating confounding.

Analysis

The analytics team first removes duplicate records, verifies units, and ensures that features are available at the time a prediction would be made. A chronological split is used: earlier deliveries form the training set, a later period forms validation data, and the most recent period is retained for testing.

A baseline model predicts every delivery using the training-set mean. A multiple linear model is then fitted:

DeliveryTime = β0 + β1Distance + β2Stops + β3Packages + β4Weather + β5Experience + ε

Weather is encoded using indicator variables, with normal weather as the reference category. A polynomial term for stops is considered because congestion may rise sharply on large routes. Ridge regression is evaluated because distance, stops, and packages are correlated.

Approach and solution

Residual plots reveal increasing error for large routes, so the team evaluates a log transformation of delivery time and robust prediction intervals. Cross-validation is performed within the training period. The test set is used once for final comparison. The selected model is not the model with the highest training R²; it is the model with strong future-period error and acceptable interpretability.

The model is embedded in the dispatch system with a confidence range rather than a single time. Managers review errors weekly, especially during holidays and severe weather. Driver experience is used for operational planning, not to penalize drivers, because the model may reflect route assignment practices rather than individual ability.

Outcome

The model improves delivery-window accuracy compared with the mean baseline and identifies route complexity as a major operational driver. However, the team does not use predictions to automatically deny delivery slots. Capacity, customer commitments, and exceptional events remain part of the decision process.

Learning points

  1. Features must be available at prediction time.
  2. Temporal validation is essential for operational forecasting.
  3. Correlation among operational variables can destabilize coefficients.
  4. Prediction intervals communicate uncertainty better than point predictions alone.
  5. Governance is needed when predictions affect workers or customers.

9. Implementation Workflow and Best Practices

A professional regression project commonly follows this sequence:

  1. Define the decision, response variable, prediction horizon, and cost of error.
  2. Establish the unit of analysis and prevent duplicate or dependent records from being treated as independent.
  3. Explore distributions, missingness, outliers, seasonality, and data availability.
  4. Create a defensible baseline.
  5. Split data according to the business process, especially time and customer grouping.
  6. Fit an interpretable model before adding complexity.
  7. Encode categorical variables consistently and standardize predictors when required by regularization.
  8. Diagnose residuals, leakage, multicollinearity, influential cases, and stability.
  9. Compare models using validation metrics aligned with business costs.
  10. Document assumptions, versions, features, training dates, and intended use.
  11. Monitor drift, calibration, error by segment, and changes in the data-generating process.
  12. Establish a human review and escalation process.

Data leakage is a particularly serious risk. Leakage occurs when information unavailable at prediction time, or information generated after the outcome, enters the predictors. Leakage can produce impressive validation results and poor real-world performance.

10. Limitations, Ethics, and Governance

Regression models inherit the limitations of their data. Historical data may reflect unequal access, discriminatory policies, selective measurement, or past managerial choices. A model that predicts customer value may systematically assign lower scores to groups with fewer historical interactions, even when their future potential is similar.

Important governance practices include:

  • documenting purpose, population, variables, and limitations;
  • checking error and performance across relevant groups;
  • protecting personal and commercially sensitive data;
  • obtaining appropriate consent and complying with applicable privacy law;
  • limiting use to the purpose for which the model was validated;
  • providing review and appeal routes when predictions affect people;
  • monitoring for drift, feedback loops, and changing market conditions.

Interpretability does not guarantee fairness. A transparent model can still encode harmful policies. Conversely, a more complex model is not automatically inappropriate, but its use requires stronger validation and explanation. The proper standard is fitness for purpose, accountability, and proportionality.

Contemporary Developments

Modern business analytics increasingly combines regression with automated machine-learning pipelines, causal experiments, time-series methods, and probabilistic forecasting. Regularized regression remains important because it is fast, auditable, and effective for many structured datasets. Generalized linear models extend regression to outcomes such as binary conversion, counts, and rates, although these require link functions and distributions appropriate to the response.

Machine-learning systems may optimize predictive accuracy through ensembles or neural networks, but regression remains a valuable benchmark and explanation tool. In practice, a business team should compare sophisticated models with a transparent baseline and select the approach that provides reliable performance, maintainability, and decision value.

Chapter Summary

Regression models estimate numerical outcomes from one or more predictors. Linear regression expresses the conditional mean as a linear combination of variables, while polynomial regression represents curvature through powers of predictors. OLS estimates coefficients by minimizing squared residuals. RMSE, MAE, and R² describe different aspects of performance, but out-of-sample validation is more important than training fit.

Valid interpretation requires attention to linearity, independence, constant variance, multicollinearity, influential observations, and the distinction between association and causation. Ridge regression controls coefficient size through an L2 penalty, while lasso uses an L1 penalty and can produce sparse models. Regression supports pricing, demand, revenue, customer value, and operational decisions, but predictions must account for uncertainty, leakage, changing conditions, fairness, privacy, and human accountability.

Key Terms

Regression: A method for modelling a numerical response using explanatory variables.

Response variable: The outcome a model seeks to explain or predict.

Predictor: An input variable used by a model.

Intercept: The fitted expected response when all predictors equal zero.

Coefficient: The estimated change associated with a predictor, conditional on other included predictors.

Residual: The observed response minus its fitted prediction.

Ordinary least squares: Estimation by minimizing the sum of squared residuals.

SSE: The sum of squared errors.

RMSE: The square root of mean squared prediction error.

MAE: Mean absolute prediction error.

R²: The proportion of sample variation reduced relative to a mean-only model.

Multicollinearity: Strong overlap or dependence among predictors.

Heteroscedasticity: Non-constant conditional error variance.

Polynomial regression: Regression using powers of one or more predictors.

Regularization: Penalization used to control model complexity.

Ridge regression: L2-penalized regression that shrinks coefficients.

Lasso regression: L1-penalized regression that can set coefficients to zero.

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

Extrapolation: Prediction outside the range represented by the training data.

Prediction interval: A range expressing uncertainty around a future individual outcome.

Review Questions

Short Answer Questions

  1. What is the difference between a response variable and a predictor?
  2. Interpret a slope coefficient in a multiple regression model.
  3. Why can a high R² fail to demonstrate causation?
  4. What does a residual represent?
  5. State one difference between ridge and lasso regression.

Long Answer Questions

  1. Explain the assumptions of ordinary least squares and describe a diagnostic for each.
  2. Compare RMSE, MAE, and R² as measures of regression performance.
  3. Explain how polynomial regression can model diminishing returns and identify its risks.
  4. Describe how a business should split data for a time-dependent forecasting problem.
  5. Discuss why multicollinearity can make coefficient interpretation difficult even when prediction is satisfactory.

Analytical / Application Questions

  1. A retailer models weekly demand using price, advertising, and a promotion indicator. Explain how you would determine whether the estimated price coefficient is useful for a pricing decision.
  2. A delivery-time model performs well on random test splits but poorly after deployment. Diagnose at least three possible causes and propose remedies.
  3. A lasso model removes a marketing-channel variable that managers consider strategically important. Explain how you would investigate the result before excluding the channel from planning.

Multiple Choice Questions with Answers

Question 1

In a multiple linear regression, what does a coefficient generally represent?

A. The unconditional average of the response

B. The expected change in the response for a one-unit predictor increase, holding other included predictors constant

C. The percentage of observations correctly classified

D. The total number of predictors in the model

Correct Answer: B. The expected change in the response for a one-unit predictor increase, holding other included predictors constant

Question 2

If a fitted model is ŷ = 20 + 4x, what is the prediction when x = 5?

A. 24

B. 40

C. 45

D. 100

Correct Answer: C. 45

Question 3

Which metric is expressed in the same units as the response variable?

A. RMSE

B. R²

C. The ridge penalty

D. The lasso penalty

Correct Answer: A. RMSE

Question 4

What is a major purpose of a validation set?

A. To guarantee causal conclusions

B. To replace the response variable

C. To select models or tune settings before final testing

D. To remove all outliers automatically

Correct Answer: C. To select models or tune settings before final testing

Question 5

Which pattern most directly suggests non-linearity in a regression model?

A. A random residual cloud around zero

B. A curved pattern in residuals versus fitted values

C. A predictor measured in dollars

D. A model with an intercept

Correct Answer: B. A curved pattern in residuals versus fitted values

Question 6

What is a typical effect of increasing the ridge penalty parameter λ?

A. It increases the magnitude of every coefficient

B. It shrinks coefficients toward zero

C. It guarantees perfect predictions

D. It removes the response variable

Correct Answer: B. It shrinks coefficients toward zero

Question 7

Which feature distinguishes lasso from ridge regression?

A. Lasso uses an absolute-value penalty and may set coefficients exactly to zero

B. Lasso cannot be used with multiple predictors

C. Lasso always has a higher test error

D. Lasso does not require a response variable

Correct Answer: A. Lasso uses an absolute-value penalty and may set coefficients exactly to zero

Question 8

Why is chronological splitting usually appropriate for forecasting?

A. It allows future information to train the model

B. It reflects the direction in which predictions will be made

C. It guarantees normally distributed errors

D. It eliminates seasonality

Correct Answer: B. It reflects the direction in which predictions will be made

Question 9

If SSE = 200 and n = 100, what is the RMSE, using RMSE = √(SSE ÷ n)?

A. 1

B. 2

C. √2 ≈ 1.41

D. 20

Correct Answer: C. √2 ≈ 1.41

Question 10

Which situation is an example of data leakage?

A. Using a predictor recorded before the prediction time

B. Standardizing training predictors

C. Using the final delivery status as a predictor of delivery time before delivery occurs

D. Evaluating a model on a held-out test set

Correct Answer: C. Using the final delivery status as a predictor of delivery time before delivery occurs

Machine Learning for Business
Chapter 6 of 15