Decision Analytics and Business ApplicationsIntroductionDecision analytics is the disciplined use of data, models, business knowledge and explicit decision criteria to improve organisational choices. It differs from reporting because a report describes what has happened, whereas decision analytics asks what should be done, why it should be done, and what consequences may follow. In business, data rarely arrives as a perfectly stated analytical problem. Managers may say that sales are falling, customers are leaving, inventory is excessive or fraud is increasing. An analyst must translate these concerns into measurable questions, key performance indicators (KPIs), analytical methods and decision rules. Python is valuable because it supports the complete workflow: data preparation, exploration, modelling, simulation, optimisation and communication. The purpose of this chapter is not to treat Python as a collection of isolated commands. It is to show how Python can support responsible decisions in marketing, finance, operations, customer management and risk analysis. Learning ObjectivesBy the end of this chapter, you should be able to: - Translate a business problem into an analytical question and decision statement.
- Select appropriate KPIs and distinguish descriptive, predictive and prescriptive analytics.
- Apply Python concepts to marketing, finance, operations, customer and risk use cases.
- Explain basic forecasting, simulation and optimisation approaches.
- Evaluate assumptions, uncertainty, performance measures and ethical risks.
- Communicate analytical results as actionable recommendations rather than isolated numbers.
From Business Problems to Analytical QuestionsA useful decision-analysis chain is: Business objective → decision → analytical question → data → method → KPI → action → evaluation. For example, “improve customer retention” is an objective. The related decision might be which customers should receive a retention offer. An analytical question could be: “Which currently active customers have a high probability of cancelling within the next 30 days and are economically worth contacting?” The data may include tenure, usage, complaints and payment history. The method might be classification, and the evaluation may compare incremental profit rather than prediction accuracy alone. A well-formed analytical question specifies: - the population being studied;
- the outcome or target variable;
- the time horizon;
- the decision-maker and available actions;
- constraints such as budget, capacity or regulation;
- the success measure.
A decision statement is often written as: For decision population P, choose action A from the feasible set to improve outcome O over time horizon T, subject to constraints C. Descriptive, Predictive and Prescriptive Analytics| Type | Main question | Typical output | Example |
|---|
| Descriptive | What happened? | Reports, summaries, dashboards | Monthly revenue by region | | Diagnostic | Why did it happen? | Segment comparisons, drivers | Reasons for delivery delays | | Predictive | What is likely to happen? | Forecasts, probabilities, scores | Probability of churn | | Prescriptive | What should we do? | Recommended action or policy | Optimal staffing schedule |
The categories are related but not interchangeable. A highly accurate forecast does not automatically identify the best action. A prescriptive recommendation requires an objective function, feasible alternatives and assumptions about how actions affect outcomes. KPIs and Decision CriteriaA KPI is a defined measure used to monitor performance against an objective. A metric becomes a KPI only when its interpretation, owner, frequency and decision relevance are clear. Common business formulas include: Conversion rate = Number of conversions ÷ Number of qualified opportunities × 100% Customer acquisition cost (CAC) = Acquisition expenditure ÷ Number of new customers acquired Retention rate = (Customers at end of period − New customers acquired during period) ÷ Customers at start of period × 100% Gross margin = (Revenue − Cost of goods sold) ÷ Revenue × 100% The conversion rate is meaningful only when the denominator is consistently defined. CAC should identify which costs are included, such as advertising, sales labour and agency fees. Retention rate assumes that beginning customers and newly acquired customers are measured consistently. Gross margin excludes operating costs unless the organisation explicitly defines a broader margin. A decision criterion converts a KPI into a rule. For example, a campaign may be approved if expected incremental profit is positive and the confidence interval does not indicate unacceptable downside risk. A single KPI can be misleading: maximising clicks may reduce profitability, and reducing delivery time may increase costs excessively. Unit Economics and Expected ValueContribution margin per customer can be expressed as: Contribution = Revenue − Variable cost If an action has possible outcomes i, each with probability pᵢ and monetary payoff vᵢ, its expected value is: E(V) = ∑ᵢ pᵢvᵢ where pᵢ ≥ 0, ∑ᵢ pᵢ = 1, and vᵢ is measured in the same currency. Expected value is useful for repeated decisions under uncertainty, but it does not describe the spread of outcomes or managerial risk tolerance. A decision with a positive expected value may still be rejected if its potential loss is unacceptable. A Python Workflow for Decision AnalyticsA reproducible workflow commonly uses pandas for tabular data, NumPy for numerical operations, matplotlib or seaborn for visualisation, scikit-learn for modelling, and scipy for selected optimisation tasks. A simplified structure is: import pandas as pd
sales = pd.read_csv("sales.csv")
sales["revenue"] = sales["quantity"] * sales["unit_price"]
summary = (sales.groupby("region", as_index=False)
.agg(revenue=("revenue", "sum"),
orders=("order_id", "nunique")))
summary["revenue_per_order"] = summary["revenue"] / summary["orders"]
print(summary)Professional analysis requires more than syntactically correct code. The analyst should inspect data types, missing values, duplicate records, impossible values and time coverage. A train–test split must respect time ordering when the goal is forecasting. Features unavailable at the time of decision must not be used, because this creates leakage and unrealistically optimistic performance. A useful project structure separates data ingestion, cleaning, analysis, modelling, validation and reporting. Version control, documented assumptions and repeatable scripts make results auditable. Marketing AnalyticsMarketing analytics links customer exposure and behaviour to outcomes such as leads, conversions, revenue and profit. Important applications include segmentation, campaign evaluation, propensity scoring and marketing-mix analysis. Campaign EvaluationSuppose a campaign contacts a treatment group while a comparable control group is not contacted. The observed response rates are rₜ and r꜀. The simple difference in response rates is: Incremental response = rₜ − r꜀ a The control group is essential because some customers would have purchased without the campaign. In practice, analysts should also compare incremental profit: Incremental profit = Incremental revenue − Incremental variable cost − Campaign cost Randomised experiments provide stronger causal evidence than before-and-after comparisons. If randomisation is not possible, matching, regression adjustment or difference-in-differences may help, but their assumptions must be stated. Python can summarise campaign data as follows: campaign.groupby("group").agg(
customers=("customer_id", "nunique"),
conversions=("converted", "sum"),
revenue=("revenue", "sum")
)A model that predicts likely buyers is not necessarily a model that identifies persuadable customers. Some customers would buy anyway; others may respond negatively to contact. The best targeting strategy therefore focuses on incremental response where experimental evidence permits. Finance AnalyticsFinance applications include cash-flow forecasting, credit assessment, portfolio monitoring, budgeting and variance analysis. A central principle is to distinguish accounting profit, cash flow and economic value. For a sequence of cash flows Cₜ at times t = 0, 1, …, n, the net present value at discount rate r is: NPV = ∑ₜ₌₀ⁿ Cₜ ÷ (1 + r)ᵗ Here C₀ is usually the initial investment and may be negative; r is a per-period discount rate; and all cash flows must use the same time unit as r. The formula assumes the discount rate is appropriate for the risk and timing of the cash flows. NPV greater than zero means the investment exceeds the value implied by the chosen discount rate, not that the investment is risk-free. Python example: cash_flows = [-10000, 3500, 4000, 4500]
r = 0.10
npv = sum(cf / (1 + r) ** t for t, cf in enumerate(cash_flows))
print(round(npv, 2)) The result is approximately 692.71 currency units. This calculation assumes annual cash flows and an annual discount rate of 10%. Financial analytics should include sensitivity analysis. For instance, revenue growth, collection rates, costs and discount rates can be varied to show how robust the recommendation is. A forecast that ignores working capital or cash timing can be unsuitable for liquidity decisions. Operations and Supply-Chain AnalyticsOperations decisions concern capacity, inventory, scheduling, procurement and service levels. The objective is often to balance cost against responsiveness. A basic inventory reorder point under uncertainty is: Reorder point = Expected demand during lead time + Safety stock If average demand per period is d and lead time is L periods, expected lead-time demand is dL. Under a simplified independent-demand assumption, if demand standard deviation per period is σ and lead time is fixed, lead-time standard deviation is approximately σ√L. Safety stock may then be calculated as: Safety stock = zσ√L where z is the selected service-level quantile. This formula assumes stable demand distribution, independent periods and fixed lead time. If lead time is variable or demand is seasonal, a more complete model is required. Python can estimate rolling demand: daily = orders.groupby("date", as_index=False)["units"].sum()
daily["rolling_7_day"] = daily["units"].rolling(7).mean()Operational KPIs include fill rate, stockout frequency, cycle time, on-time delivery and capacity utilisation. High utilisation may appear efficient but can make a system fragile when demand fluctuates. Customer Analytics and ChurnCustomer analytics examines acquisition, engagement, service use, satisfaction, lifetime value and churn. Churn modelling is commonly framed as binary classification, where the target equals 1 if a customer leaves within a defined future window. A logistic model estimates the probability of an outcome using: P(Y = 1 | x) = 1 ÷ (1 + e⁻⁽ᵝ⁰ ⁺ ᵝ¹ˣ¹ ⁺ ⋯ ⁺ ᵝᵖˣᵖ⁾) Y is the binary outcome, xⱼ are predictors, βⱼ are estimated coefficients and e is the base of natural logarithms. The model produces probabilities, not guaranteed outcomes. Predictors must be measured before the prediction date, and the target window must be defined clearly. Accuracy is often inadequate for imbalanced churn data. Relevant measures include precision, recall, the area under the ROC curve, calibration and expected profit. A threshold should reflect contact cost, offer cost, expected saved margin and customer experience. A model should not automatically target every high-risk customer if intervention is ineffective or harmful. Basic ForecastingForecasting estimates future values from historical observations and explanatory information. A naïve forecast uses the latest observation: Forecast for t + 1 = Actual value at t For seasonal data, a seasonal naïve forecast uses the value from the corresponding prior season. These simple methods are important benchmarks. A complex model should outperform a suitable benchmark on a time-ordered holdout set, not merely on training data. A moving average of window k is: Moving average at t = (yₜ₋₁ + yₜ₋₂ + ⋯ + yₜ₋ₖ) ÷ k where y represents the observed variable and k is a positive integer. Moving averages smooth noise but lag behind sudden changes. Forecast accuracy can be measured using mean absolute error: MAE = (1 ÷ n)∑ᵢ₌₁ⁿ |yᵢ − ŷᵢ| where yᵢ is the actual value, ŷᵢ is the forecast and n is the number of evaluation observations. MAE has the same units as the target and is easy to interpret. Percentage measures can be problematic when actual values are zero or near zero. Simulation and Scenario AnalysisSimulation represents uncertain processes by repeatedly generating possible outcomes. It is useful when analytical formulas are difficult or when managers need a distribution of results rather than one estimate. For example, a retailer may simulate annual profit using uncertain demand, price and variable cost: import numpy as np
rng = np.random.default_rng(42)
demand = rng.normal(10000, 1500, 10000).clip(0)
price = 25
variable_cost = 14
fixed_cost = 60000
profit = demand * (price - variable_cost) - fixed_cost
probability_loss = np.mean(profit < 0)
print(probability_loss) The normal distribution assumption is illustrative and should be checked against historical data or expert knowledge. The simulation estimates the probability of loss under the specified assumptions; it does not prove that the assumptions are correct. Correlations among variables, extreme events and model risk should be considered. Scenario analysis changes selected assumptions deliberately, such as low, central and high demand. Monte Carlo simulation samples from probability distributions many times. Results should be reported using percentiles, expected values and downside measures, not only averages. Optimisation ConceptsOptimisation selects the best feasible decision according to an objective function. A general form is: Maximise or minimise f(x) subject to gⱼ(x) ≤ bⱼ, j = 1, …, m x represents decision variables, f(x) is the objective, gⱼ(x) are constraint functions and bⱼ are limits. The feasible set consists of decisions satisfying all constraints. A linear programming example allocates products to limited machine hours: Maximise: 40x₁ + 30x₂ subject to: 2x₁ + x₂ ≤ 100 x₁ + 2x₂ ≤ 80 x₁, x₂ ≥ 0 Here x₁ and x₂ are production quantities and the objective coefficients are contribution margins. Linear programming assumes linear relationships and divisible decision variables unless integer restrictions are added. Real decisions may require binary variables, nonlinear constraints or multiple objectives. In Python, optimisation can be implemented with tools such as scipy.optimize or specialised linear-programming packages. The analyst must validate the solution operationally: a mathematically optimal schedule is not useful if it violates labour rules, ignores changeover time or relies on unavailable data. Illustrative Case: FreshBite Subscription RetentionBackgroundFreshBite, a fictional meal-subscription company, has rising cancellation rates. Management has a limited monthly budget for retention offers and wants to improve profit rather than merely reduce reported churn. ProblemThe initial request is “identify customers likely to churn.” The analyst reformulates it as: “Among active customers, which customers are likely to cancel within 30 days, likely to respond to an offer, and economically valuable enough to justify contact?” AnalysisThe team combines subscription history, delivery complaints, order frequency, payment events and prior offer responses. It defines churn as cancellation or non-renewal within 30 days. Data is split by time: earlier months train the model and the most recent month evaluates it. Customer records created after the prediction date are excluded to prevent leakage. The team first establishes a baseline: contact no one and measure expected cancellations and margin. It then evaluates a logistic churn model and an experimental offer policy. Because a high-risk customer may not be persuadable, the team compares contacted and control customers within risk segments. The economic decision rule is based on expected incremental contribution: Expected incremental contribution = p(response) × saved margin − offer cost − contact cost The probabilities and costs must be estimated from valid historical or experimental evidence. Customers are contacted only when the value is positive, capacity is available and the policy satisfies privacy and fairness requirements. OutcomeThe company finds that complaint history predicts churn, but a discount is effective mainly for customers with moderate rather than extreme risk. It therefore introduces a service-recovery message for complaint-heavy customers and a smaller incentive for a persuadable segment. The policy is monitored using a holdout group. Learning PointsThe case demonstrates that prediction is not the same as intervention. A useful project defines the decision before modelling, evaluates incremental outcomes, includes costs, respects time order and tests whether an action changes behaviour. Limitations, Ethics and GovernanceDecision analytics can fail through poor data, ambiguous definitions, sampling bias, leakage, unstable relationships or inappropriate objectives. Correlation does not establish causation. Historical data may encode past discrimination, unequal access or inconsistent service. Responsible practice includes: - documenting data sources, definitions and transformations;
- collecting only data necessary for the stated purpose;
- protecting personal and sensitive information;
- controlling access and retaining audit logs;
- testing performance across relevant demographic and operational groups;
- explaining decisions at an appropriate level;
- providing human review and appeal where decisions materially affect people;
- monitoring drift after deployment.
Privacy laws and sector rules may restrict automated profiling, credit decisions, employment decisions and use of sensitive attributes. Compliance is not merely a technical setting; it requires organisational governance, lawful purpose, transparency and accountability. AI tools can accelerate coding, feature generation and natural-language reporting, but generated code and interpretations require verification. An AI system may reproduce bias, expose confidential data or produce plausible but unsupported conclusions. Human analysts remain responsible for validation and communication. Best Practices for Professional Decision Analytics- Start with the decision, not the dataset.
- Define KPIs, denominators, units and time windows explicitly.
- Establish a simple baseline before using complex models.
- Separate training, validation and final evaluation appropriately.
- Match evaluation metrics to financial and operational consequences.
- Quantify uncertainty and test sensitivity to assumptions.
- Distinguish prediction from causal impact.
- Use control groups when intervention effects matter.
- Document limitations, ownership and monitoring plans.
- Present a recommendation, alternatives, risks and next actions.
Chapter SummaryDecision analytics translates organisational objectives into measurable questions, KPIs, models and actions. Descriptive analytics explains the past, predictive analytics estimates likely outcomes, and prescriptive analytics evaluates feasible actions under constraints. Python supports data preparation, KPI calculation, forecasting, simulation, modelling and optimisation, but technical code does not replace sound problem definition. Marketing analysis should distinguish incremental response from natural purchasing. Finance analysis must align cash-flow timing and discount rates. Operations analysis balances capacity, inventory, cost and service. Customer analytics requires clearly defined targets and economically meaningful thresholds. Forecasting needs time-aware validation and suitable baselines. Simulation exposes uncertainty, while optimisation selects the best feasible decision under explicit assumptions. Responsible analysts document definitions, prevent leakage, assess bias, protect personal data, communicate uncertainty and monitor deployed solutions. The central professional skill is connecting analytical evidence to a defensible decision. Key TermsDecision analytics: Use of data, models and criteria to improve choices. KPI: A defined performance measure linked to an organisational objective. Descriptive analytics: Analysis of what has happened. Predictive analytics: Estimation of future or unknown outcomes. Prescriptive analytics: Evaluation or recommendation of actions. Decision criterion: Rule used to judge or select an action. Conversion rate: Proportion of defined opportunities producing a conversion. Customer acquisition cost: Acquisition expenditure per new customer. Incremental effect: Outcome caused by an action beyond what would otherwise occur. Control group: Comparable group not receiving the intervention. Net present value: Present value of timed cash inflows and outflows. Forecast: Estimate of a future value or event. MAE: Mean absolute error between actual and forecast values. Simulation: Repeated generation of possible outcomes under stated assumptions. Optimisation: Selection of the best feasible decision according to an objective. Constraint: Requirement limiting allowable decisions. Data leakage: Use of information unavailable at the time of prediction. Calibration: Agreement between predicted probabilities and observed frequencies. Model drift: Change in data or relationships that reduces model performance. Expected value: Probability-weighted average of possible outcomes. Review Questions5 Short Answer Questions- What is the difference between predictive and prescriptive analytics?
- Why must a KPI have a clearly defined denominator?
- State two assumptions of the simplified safety-stock formula.
- Why is a control group useful in campaign evaluation?
- What is data leakage, and why does it matter?
5 Long Answer Questions- Explain how a vague business problem can be translated into a decision statement, analytical question and evaluation plan.
- Compare descriptive, predictive and prescriptive analytics using a customer-retention example.
- Discuss how Python supports a reproducible decision-analytics workflow.
- Explain why a financially attractive forecast or model may still produce a poor business decision.
- Describe the ethical and governance controls required for customer or credit analytics.
3 Analytical / Application Questions- A campaign contacts 4,000 customers and has a 6% conversion rate; a control group of 4,000 has a 4% conversion rate. Calculate the incremental response rate and explain what additional cost and margin information is needed before approving the campaign.
- A warehouse has average daily demand of 200 units, a fixed lead time of 5 days, daily demand standard deviation of 30 units and a service-level factor z = 1.65. Using the simplified safety-stock formula, calculate safety stock and the reorder point. State the assumptions.
- Design a decision policy for a subscription business using churn probability, saved contribution margin, offer cost and contact capacity. Specify the target variable, evaluation method, economic criterion and at least two governance safeguards.
Multiple Choice Questions with AnswersQuestion 1Which statement best describes prescriptive analytics? A. It summarises historical transactions B. It recommends or evaluates actions under constraints C. It stores data in a relational table D. It removes all uncertainty from a decision Correct Answer: B. It recommends or evaluates actions under constraints Question 2A campaign treatment group has a 6% response rate and its control group has a 4% response rate. What is the simple incremental response rate? A. 1 percentage point B. 2 percentage points C. 10 percentage points D. 150 percentage points Correct Answer: B. 2 percentage points Question 3Which practice most directly prevents temporal data leakage in forecasting? A. Randomly shuffling all observations before splitting B. Using future observations as explanatory variables C. Splitting training and testing data according to time order D. Removing the target variable from the dataset Correct Answer: C. Splitting training and testing data according to time order Question 4In the formula NPV = ∑ Cₜ ÷ (1 + r)ᵗ, what does r represent? A. The number of cash-flow periods B. The discount rate per period C. The initial cash flow only D. The forecast error Correct Answer: B. The discount rate per period Question 5Which measure has the same units as the forecasted business variable? A. Mean absolute error B. Conversion percentage only C. Probability of loss D. Discount rate Correct Answer: A. Mean absolute error Question 6What is the main purpose of a control group in a marketing experiment? A. To increase the campaign budget B. To estimate what would have happened without the intervention C. To guarantee every customer responds D. To replace the need for a defined KPI Correct Answer: B. To estimate what would have happened without the intervention Question 7In a linear optimisation model, a constraint is best understood as: A. A limit on feasible decisions B. A forecast error measure C. A customer identifier D. A random number generator Correct Answer: A. A limit on feasible decisions Question 8Which formula represents expected value for possible outcomes with probabilities pᵢ and values vᵢ? A. E(V) = ∑ᵢ pᵢvᵢ B. E(V) = ∑ᵢ pᵢ + vᵢ C. E(V) = ∑ᵢ vᵢ ÷ pᵢ D. E(V) = max(vᵢ) only Correct Answer: A. E(V) = ∑ᵢ pᵢvᵢ Question 9Why might a high churn-probability customer not be the best customer to target? A. Churn probabilities are never useful B. The customer may be unpersuadable or the intervention may cost more than its benefit C. High-risk customers always have zero value D. Prediction models cannot use customer history Correct Answer: B. The customer may be unpersuadable or the intervention may cost more than its benefit Question 10Which governance practice is most appropriate when an analytical model affects people materially? A. Deploying it without monitoring B. Hiding the model purpose from decision-makers C. Providing documentation, performance monitoring and human review D. Using every available personal attribute Correct Answer: C. Providing documentation, performance monitoring and human review
|