Elective Data Mining & Warehousing

Chapter 8
Regression, Forecasting and Decision Analytics

Post Graduate Program in Computer Science Engineering
Elective Data Mining & Warehousing   •   Post Graduate

8. Regression, Forecasting and Decision Analytics

Introduction and Context

Data mining is not limited to discovering patterns in historical data. Its practical value is realized when discovered patterns support estimates, forecasts, resource allocation, and action. Regression, forecasting, and decision analytics form a connected set of methods for this purpose. Regression estimates relationships between variables; forecasting projects values into the future; decision analytics uses predictions, uncertainty, constraints, and objectives to recommend or evaluate actions.

A retailer may estimate how price affects demand, forecast next month’s sales, and then determine how much inventory to order. A bank may estimate default probability, forecast cash flows, and decide whether to approve a loan. A manufacturer may predict equipment failure and optimize maintenance schedules. In each case, prediction alone is insufficient. The organization must also understand uncertainty, alternative scenarios, costs of error, and operational constraints.

This chapter develops these ideas from statistical foundations to managerial application. It emphasizes not only how models are fitted, but also how their outputs should be interpreted and connected with decisions.

Learning Objectives

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

1. Explain the role of regression, forecasting, and decision analytics in data mining and warehousing.

2. Formulate and interpret linear, nonlinear, logistic, and regularized regression models.

3. Distinguish cross-sectional regression from time-series forecasting.

4. Diagnose model assumptions, predictive performance, and uncertainty.

5. Apply decomposition, exponential smoothing, ARIMA-oriented reasoning, and rolling validation to time-series data.

6. Conduct scenario analysis, sensitivity analysis, and cost-sensitive evaluation.

7. Connect predictive models with optimization and managerial decisions.

8. Recognize ethical, governance, technical, and organizational risks in predictive decision systems.

From Descriptive Patterns to Decisions

A descriptive warehouse report may show that sales declined in a particular region. A predictive model asks what sales are likely to be next quarter, perhaps under alternative prices or advertising budgets. A prescriptive or decision-analytic model asks what the organization should do, given predicted demand, costs, capacity, and risk tolerance.

These activities are related but not identical. A model can be statistically accurate and still lead to poor decisions if it ignores action costs, operational constraints, or changes caused by the decision itself. For example, a demand model trained on historical prices may predict sales accurately within the observed price range, but it may not reliably estimate the effect of a completely new pricing policy.

A useful analytical chain is:

Data and measurement → estimation or forecasting → uncertainty assessment → scenarios → optimization or choice → monitoring and revision.

Data warehouses and data lakes supply historical observations, dimensions, measures, and contextual variables. Feature engineering converts raw records into variables suitable for modeling. Model governance then ensures that the analytical output is reproducible, explainable, monitored, and used appropriately.

Regression as an Estimation Framework

Simple and Multiple Linear Regression

In simple linear regression, a response variable is represented as:

y = β₀ + β₁x + ε

where β₀ is the intercept, β₁ is the expected change in y associated with a one-unit increase in x, and ε represents unexplained variation. In multiple regression:

y = β₀ + β₁x₁ + β₂x₂ + ... + βₚxₚ + ε.

The coefficients are commonly estimated by ordinary least squares, which minimizes the sum of squared residuals. A fitted coefficient should be interpreted conditionally: βⱼ describes the expected association between xⱼ and y while holding the other included variables constant. This is not automatically a causal effect. Omitted variables, reverse causality, measurement error, and selection bias may make causal interpretation inappropriate.

Categorical variables are represented through indicator or dummy variables. If region has categories North, South, and West, one category is normally treated as a reference category. The coefficient for South then represents the expected difference between South and the reference region, conditional on other variables.

Interaction terms allow the effect of one predictor to depend on another. A model containing advertising expenditure, season, and their interaction can represent a different advertising response during peak and off-peak periods. Polynomial terms or transformations such as logarithms can represent curvature, diminishing returns, or multiplicative relationships.

Measuring Fit and Predictive Performance

The coefficient of determination, R², indicates the proportion of in-sample variation explained by the model relative to a baseline containing the mean. Adjusted R² penalizes the inclusion of unnecessary predictors. Neither measure is sufficient for evaluating out-of-sample performance.

For continuous outcomes, common measures include:

  • Mean absolute error (MAE): the average absolute prediction error; easy to interpret in the original units.
  • Mean squared error (MSE): the average squared error; gives greater weight to large errors.
  • Root mean squared error (RMSE): the square root of MSE; expressed in the outcome’s units.
  • Mean absolute percentage error (MAPE): a relative measure, but problematic when actual values are zero or close to zero.

A model should be evaluated on data not used for fitting. In ordinary predictive settings, training, validation, and test sets may be used. For time-dependent data, random splitting can leak future information into the training set; chronological or rolling-origin validation is more appropriate.

Assumptions and Diagnostics

Classical linear regression relies on assumptions that should be examined rather than accepted automatically. Important concerns include nonlinearity, nonconstant error variance, correlated residuals, non-normal residuals for small-sample inference, multicollinearity, influential observations, and dependence between observations.

Residual plots can reveal curvature and heteroscedasticity. A funnel-shaped residual pattern suggests that error variance changes with the predicted level. The variance inflation factor can help identify multicollinearity, although no single threshold should replace substantive judgment. High multicollinearity may make individual coefficients unstable even when overall predictions remain useful. Leverage and influence diagnostics identify observations that exert disproportionate effects on fitted coefficients.

A statistically significant coefficient may have little operational importance. Conversely, a modest effect may be valuable if it applies to a large population or affects a high-cost decision. Interpretation should therefore combine statistical evidence, effect size, uncertainty intervals, domain knowledge, and decision consequences.

Regularization and Model Flexibility

When the number of predictors is large or predictors are correlated, ordinary least squares can overfit. Ridge regression shrinks coefficients toward zero by adding a penalty proportional to the sum of squared coefficients. Lasso regression uses the sum of absolute coefficients and can set some coefficients exactly to zero, supporting variable selection. Elastic net combines both penalties.

The regularization parameter should be selected through validation. Standardization is generally important because penalty terms are scale-sensitive. Regularization improves generalization in many settings, but the selected model is not automatically causal or unbiased. It is a tool for controlling variance and improving prediction.

Beyond Ordinary Regression

For a binary outcome, logistic regression models the log-odds of the event:

log[p/(1 − p)] = β₀ + β₁x₁ + ... + βₚxₚ.

The exponential of a coefficient is an odds ratio, not a probability difference. Probability changes depend on the starting probability and the values of other predictors. Classification thresholds should be selected in relation to the costs of false positives and false negatives, not merely fixed at 0.5.

Count outcomes may be modeled with Poisson or negative binomial regression, while censored or duration outcomes may require survival models. Generalized additive models and tree-based methods can capture nonlinear relationships. More flexible methods may improve predictive accuracy but can reduce interpretability, complicate extrapolation, and require stronger governance.

Forecasting Dynamic Data

Regression generally focuses on relationships among observations and predictors. Forecasting focuses on the ordering and evolution of observations over time. Time-series data may contain trend, seasonality, cycles, irregular variation, structural breaks, and dependence across successive observations.

Components of a Time Series

A series can be viewed conceptually through additive decomposition:

Yₜ = Tₜ + Sₜ + Rₜ,

where Tₜ is trend, Sₜ is seasonal variation, and Rₜ is the remainder. A multiplicative decomposition is more suitable when seasonal fluctuations grow with the level:

Yₜ = Tₜ × Sₜ × Rₜ.

Trend describes long-run movement. Seasonality is a recurring pattern associated with calendar or operational cycles. Cycles are longer and less regular movements, often associated with economic conditions. The residual contains random variation and unmodeled effects.

Moving averages smooth short-term noise and help reveal trend. Seasonal indices summarize systematic deviations from a trend or average level. Decomposition is useful for understanding a series, but it should not be mistaken for a complete forecasting model.

Smoothing Methods

Naïve forecasting uses the latest observation as the next forecast and is often a strong baseline. Seasonal naïve forecasting uses the observation from the corresponding prior season. These baselines are essential because a complex model should demonstrate improvement over simple alternatives.

Simple exponential smoothing is appropriate for a series without systematic trend or seasonality. It updates the level using a smoothing parameter α between zero and one. Holt’s method extends smoothing to trend, while Holt–Winters methods incorporate seasonality. Larger smoothing parameters react more rapidly to recent changes but may also respond excessively to noise.

Autoregressive and ARIMA-Oriented Reasoning

An autoregressive model predicts the current value from previous values. A moving-average error component represents dependence on previous forecast errors. ARIMA models combine autoregression, differencing, and moving-average components. Differencing can help transform a nonstationary series into one whose statistical properties are more stable over time.

Stationarity is a modeling concept, not a guarantee that the real-world process is permanently stable. Structural breaks, policy changes, new competitors, and unusual shocks can invalidate historical relationships. Autocorrelation plots, residual diagnostics, domain knowledge, and rolling evaluation should be used together when selecting a time-series model.

External variables can be incorporated through dynamic regression or related forecasting models. However, a predictor must itself be available at forecast time, or its future values must be forecast separately. Using a variable that is known only after the outcome occurs creates leakage.

Forecast Intervals and Calibration

A point forecast gives a central estimate; a prediction interval represents a range of plausible future outcomes under model assumptions. Forecast uncertainty usually increases with the forecast horizon. A forecast interval should not be interpreted as a guarantee that the actual value will lie inside it, especially when structural change is possible.

Forecast systems should be evaluated for both accuracy and calibration. A model that is usually close but systematically underestimates demand may be worse for inventory planning than a slightly less accurate model with unbiased errors. Interval coverage, bias, error distribution, and performance across products or regions should be monitored.

From Predictions to Decision Analytics

Prediction becomes decision support when it is connected to an objective, feasible actions, constraints, and consequences. A decision model can be expressed as:

Choose action a ∈ A to maximize expected utility U(a, θ),

where θ represents uncertain future conditions. In a cost-minimization problem, the objective may combine purchasing, holding, shortage, labor, and service-level costs. A prediction supplies information about θ, but the recommended action depends on the cost structure and feasible action set.

Scenario and Sensitivity Analysis

Scenario analysis evaluates outcomes under coherent assumptions such as high demand, supply disruption, or a new regulatory requirement. It is not the same as assigning arbitrary values to every input. Good scenarios identify which assumptions change, why they change, and how plausible the resulting combination is.

Sensitivity analysis varies one or more inputs to determine how strongly the recommendation responds. One-way sensitivity analysis changes one variable at a time. Multiway analysis varies several variables, while Monte Carlo simulation samples from specified probability distributions to estimate a distribution of outcomes. Sensitivity results identify critical assumptions, break-even points, and information priorities.

For example, if a warehouse expansion remains profitable for demand growth between 5 and 25 percent but becomes unattractive when construction cost exceeds a threshold, management knows which uncertainty deserves closer investigation.

Optimization and Prescriptive Analytics

A common structure is:

Maximize or minimize f(x)

subject to resource, capacity, policy, and non-negativity constraints. Linear programming is appropriate when the objective and constraints are linear. Integer programming handles discrete choices such as opening a facility or assigning a vehicle. Nonlinear, stochastic, and robust optimization address more complex relationships and uncertainty.

Predict-then-optimize workflows first generate forecasts and then solve an optimization problem. This separation is practical but may not minimize decision loss. Decision-focused approaches evaluate predictions according to their effect on the final action. Robust optimization seeks solutions that perform acceptably across a range of uncertain conditions rather than optimizing only for a single expected forecast.

The analyst must distinguish correlation from controllable response. A sales prediction based on historical advertising does not automatically identify the sales increase caused by additional advertising. Causal experiments, quasi-experimental methods, or structural assumptions may be needed when the decision changes the data-generating process.

Applied Case: Forecast-Based Inventory Planning

Background

The following is an illustrative case of a regional online retailer selling household appliances. The retailer maintains sales, promotion, price, inventory, delivery, and product-category data in a warehouse. Stockouts are costly because customers often switch suppliers, while excess inventory creates storage and financing costs.

Situation and Problem

The purchasing department uses a monthly sales forecast but frequently overrides it informally. Managers report that the forecast is accurate during stable periods but fails during promotions and supply disruptions. The organization needs a process that combines demand estimation, time-series forecasting, uncertainty, and ordering decisions.

Analysis

The data science team first created a product-by-region panel with monthly demand, price, promotion indicators, holidays, inventory availability, and supplier lead time. It identified that observed sales were lower than true demand during stockouts. Treating all observed sales as unconstrained demand would systematically underestimate future requirements.

A baseline seasonal-naïve model was compared with exponential smoothing and a dynamic regression model containing price, promotion, holiday, and lagged demand variables. Evaluation used rolling-origin validation: each forecast was generated using only information available at that date. Performance was measured with MAE, bias, and service-level outcomes rather than RMSE alone.

The analysis showed that promotions changed both the level and seasonal pattern of demand. It also showed that price coefficients varied by product category. Because some product categories had sparse histories, regularization was used to reduce unstable estimates. Forecast intervals were widened for products with irregular supplier lead times.

Approach and Decision Strategy

The retailer used the forecast distribution rather than only the point forecast. For each product, an inventory model considered expected demand during lead time, ordering cost, holding cost, shortage cost, and warehouse capacity. A service-level constraint was applied to strategically important products. Scenario analysis examined normal demand, promotion demand, and a supply-delay scenario.

The system produced a recommended order quantity, an interval of expected inventory outcomes, and an explanation of the main drivers. Buyers retained authority to override recommendations, but overrides required a reason code. These codes were later analyzed to determine whether overrides improved results or introduced avoidable bias.

Outcome

The key improvement was not simply a lower forecast error. The organization gained a consistent connection between forecast uncertainty and inventory policy. Managers could see when a recommendation was sensitive to promotion assumptions or lead-time uncertainty. Monitoring focused on forecast bias, stockout frequency, excess inventory, service levels, and the performance of overridden decisions.

Learning Points

The case demonstrates that demand forecasting must account for censored observations, future availability of predictors, and operational costs. It also illustrates that a model should be assessed by the quality of decisions it supports, not only by a statistical error score. Human judgment remains useful, but it should be structured, recorded, and evaluated.

Challenges, Risks, and Professional Governance

Data leakage is one of the most serious risks. It occurs when information unavailable at prediction time enters model training, producing unrealistic performance. Temporal leakage, target leakage, and post-decision variables require explicit checks.

Another risk is distribution shift. A model trained under one pricing regime, customer population, or economic environment may fail after conditions change. Monitoring should compare current feature distributions, residuals, calibration, and subgroup performance with development conditions.

Fairness is particularly important when predictions influence credit, employment, insurance, healthcare, or access to essential services. A model can produce unequal error rates even when sensitive attributes are excluded, because proxy variables may preserve group information. Governance should address lawful data use, transparency, contestability, privacy, data minimization, access control, and human accountability.

Common professional mistakes include relying on R² alone, randomly splitting time-series data, interpreting association as causation, ignoring baseline models, reporting point forecasts without intervals, optimizing an unrealistic objective, and failing to document assumptions. Reproducible pipelines, versioned data and models, approval procedures, drift monitoring, and rollback plans are practical controls.

Technology and Emerging Developments

Modern analytical platforms integrate warehouse tables, distributed processing, notebooks, automated model training, feature stores, model registries, and monitoring services. These technologies improve scale and reproducibility, but automation does not remove the need for statistical judgment. Automated forecasting may select models efficiently while still failing to understand a structural break or a business policy change.

Probabilistic forecasting, hierarchical forecasting, conformal prediction, causal machine learning, and decision-focused learning are important developments. Hierarchical methods seek coherent forecasts across product, region, and total levels. Conformal approaches can construct prediction sets under stated assumptions. Causal methods estimate effects of interventions rather than merely predicting outcomes. Generative and deep-learning models can assist scenario generation and representation learning, but their use requires careful validation, traceability, and protection against fabricated or unsupported outputs.

Best Practices for Implementation

A reliable implementation should:

  • Define the decision, forecast horizon, unit of analysis, and cost of errors before selecting a model.
  • Establish naïve and seasonal baselines.
  • Use time-aware validation whenever observations are temporally ordered.
  • Separate explanatory analysis from causal claims.
  • Report point estimates together with intervals, assumptions, and known limitations.
  • Test leakage, missingness, outliers, structural breaks, and subgroup performance.
  • Evaluate forecasts using both statistical measures and operational outcomes.
  • Use scenarios and sensitivity analysis to reveal fragile recommendations.
  • Connect optimization models to real constraints, capacities, and policies.
  • Monitor performance after deployment and maintain a documented human override process.

Chapter Summary

Regression estimates relationships between a response and explanatory variables, while forecasting models the future evolution of ordered observations. Linear, logistic, regularized, and generalized regression methods address different outcome types and modeling objectives. Time-series forecasting requires attention to trend, seasonality, autocorrelation, stationarity, structural change, and chronological validation. Prediction intervals express uncertainty and should accompany point forecasts when decisions are consequential.

Decision analytics extends prediction by incorporating objectives, costs, constraints, feasible actions, and uncertainty. Scenario analysis examines coherent alternative futures; sensitivity analysis identifies influential assumptions; optimization selects actions under constraints. The quality of an analytical system must therefore be judged by both predictive performance and decision outcomes. Governance, fairness, privacy, leakage prevention, monitoring, and human accountability are essential when predictive outputs affect people or resources.

Key Terms

Regression: A method for estimating the relationship between a response and one or more predictors.

Residual: The difference between an observed value and its fitted or predicted value.

R²: The proportion of in-sample variation explained relative to a mean-only baseline.

Regularization: A method that penalizes model complexity to reduce overfitting.

Ridge regression: Regression using an L2, or squared-coefficient, penalty.

Lasso regression: Regression using an L1, or absolute-coefficient, penalty that can produce sparse models.

Logistic regression: A model for binary outcomes based on log-odds.

Multicollinearity: Strong dependence among predictors that can make coefficient estimates unstable.

Time series: Observations indexed in temporal order.

Trend: Persistent long-term movement in a time series.

Seasonality: A recurring pattern associated with a calendar or operational cycle.

Stationarity: A condition in which relevant statistical properties remain stable over time.

Exponential smoothing: A forecasting family that weights recent observations more heavily.

ARIMA: A time-series model combining autoregression, differencing, and moving-average error terms.

Prediction interval: A range expressing uncertainty about a future or unobserved value.

Data leakage: Use of information during training that would not be available at prediction time.

Scenario analysis: Evaluation of outcomes under coherent alternative assumptions.

Sensitivity analysis: Examination of how results change when inputs or assumptions vary.

Prescriptive analytics: Analysis that recommends actions using predictions, objectives, and constraints.

Robust optimization: Optimization designed to perform acceptably under uncertainty or adverse conditions.

Review Questions

Short Answer Questions

1. Why is a high R² not sufficient evidence that a regression model will forecast well?

2. Distinguish trend from seasonality in a time series.

3. What is the purpose of regularization?

4. Why should random train-test splitting generally be avoided for time-series data?

5. Define data leakage and give one example.

Long Answer Questions

1. Explain the assumptions and diagnostic procedures relevant to multiple linear regression.

2. Compare simple exponential smoothing, Holt’s method, and seasonal forecasting methods.

3. Discuss how forecast intervals and sensitivity analysis support managerial decisions.

4. Explain how regression and forecasting outputs can be connected with linear or integer optimization.

5. Discuss ethical and governance requirements for predictive systems used in high-impact decisions.

Analytical / Application Questions

1. A retailer’s demand model performs well on historical data but underestimates demand during promotions. Design a validation and modeling approach to address the problem.

2. A bank must choose a loan approval threshold. Explain how class probabilities, false-positive and false-negative costs, calibration, and fairness considerations should influence the decision.

3. A manufacturer receives a forecast with a wide prediction interval for component demand. Explain how scenario analysis, lead-time uncertainty, capacity constraints, and robust optimization could be used to determine an order policy.

22. Multiple Choice Questions with Answers

Question 1

Which interpretation of a multiple-regression coefficient is most appropriate?

A. It proves that the predictor causes the response to change.

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

C. It equals the percentage of total variation explained by the model.

D. It is valid only when the model has an R² above 0.80.

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

Question 2

Why is rolling-origin validation preferred for many forecasting problems?

A. It removes all random variation from the data.

B. It guarantees that forecast intervals are narrow.

C. It evaluates forecasts using information that would have been available at each historical forecast date.

D. It eliminates the need for a test set.

Correct Answer: C. It evaluates forecasts using information that would have been available at each historical forecast date.

Question 3

Which method is especially associated with shrinking some coefficients exactly to zero?

A. Lasso regression

B. Ordinary least squares

C. Simple exponential smoothing

D. Seasonal naïve forecasting

Correct Answer: A. Lasso regression

Question 4

A funnel-shaped residual plot most directly suggests which issue?

A. Perfect multicollinearity

B. Nonconstant error variance

C. A guaranteed causal relationship

D. Correct seasonal adjustment

Correct Answer: B. Nonconstant error variance

Question 5

Why can a point forecast be inadequate for inventory planning?

A. Point forecasts cannot use historical data.

B. Inventory decisions depend on uncertainty, shortage costs, and capacity as well as expected demand.

C. Point forecasts are always biased upward.

D. Optimization models cannot use numerical forecasts.

Correct Answer: B. Inventory decisions depend on uncertainty, shortage costs, and capacity as well as expected demand.

Question 6

Which situation is an example of data leakage?

A. Using last year’s sales to predict this year’s sales

B. Using a product category known before prediction

C. Using a variable recorded after the outcome to train a model that predicts that outcome

D. Using a validation set to compare two models

Correct Answer: C. Using a variable recorded after the outcome to train a model that predicts that outcome

Question 7

What is the primary purpose of sensitivity analysis?

A. To prove that a model is causal

B. To determine how changes in assumptions affect results or recommendations

C. To replace all domain knowledge

D. To ensure that every forecast is exactly correct

Correct Answer: B. To determine how changes in assumptions affect results or recommendations

Question 8

In logistic regression, exponentiating a coefficient usually produces an interpretation as a change in:

A. The odds ratio, conditional on the model specification

B. The response mean in original units

C. The time-series trend

D. The forecast interval width

Correct Answer: A. The odds ratio, conditional on the model specification

Question 9

Which statement best describes prescriptive analytics?

A. It only summarizes historical records.

B. It recommends actions using predictions, objectives, and constraints.

C. It excludes uncertainty from decision-making.

D. It is identical to calculating R².

Correct Answer: B. It recommends actions using predictions, objectives, and constraints.

Question 10

Why might a statistically accurate forecasting model still support a poor managerial decision?

A. Accuracy metrics are never useful.

B. The model may ignore action costs, constraints, uncertainty, or the effect of decisions on future data.

C. Forecasts cannot be used in optimization.

D. Managers are not allowed to use model outputs.

Correct Answer: B. The model may ignore action costs, constraints, uncertainty, or the effect of decisions on future data.

Elective Data Mining & Warehousing
Chapter 8 of 14