Showing posts with label data storytelling. Show all posts
Showing posts with label data storytelling. Show all posts

Wednesday, February 4, 2026

When Better Numbers Make Worse Decisions

The Metric That Improved—Without Anything Getting Better

The Metric That Improved—Without Anything Getting Better

Every large organization eventually encounters a moment of confusion that feels almost surreal. The dashboards look better. The reports are positive. The trend lines slope upward. And yet — on the ground — nothing feels improved.

Customers are still unhappy. Engineers are still firefighting. Costs are still rising. People begin to ask a dangerous question:

“If the metric improved, why does everything feel worse?”

This is not a failure of effort. It is not even a failure of intelligence. It is a failure of aggregation.

This is the story of how metrics lie — not maliciously, but mathematically — through Simpson’s paradox and aggregation bias.

A nationwide logistics company rolls out a performance initiative. The headline KPI is simple: average delivery time. Leadership announces success after six months. Average delivery time has dropped by 12%. Bonuses are paid. Celebrations follow.

And yet, customer churn accelerates.

The Comfort of a Single Number

Humans crave compression. We want one number that tells us whether things are good or bad. Average delivery time feels perfect. It is quantitative, comparable, and easy to trend.

But averages are dangerous. They collapse diverse realities into a single scalar. And when populations shift, averages can improve while every subgroup deteriorates.

This is the core intuition behind Simpson’s paradox, a phenomenon often introduced in statistics courses but rarely internalized in decision-making.

If this sounds abstract, pause here and read how aggregation visually distorts relationships . The math is not complicated — the implications are.

What Simpson’s Paradox Really Is (Without the Toy Examples)

Simpson’s paradox occurs when a trend appears in aggregated data but reverses or disappears when the data is disaggregated.

Most explanations rely on contrived tables. Real life is messier. Populations change. Mixes shift. Constraints reallocate pressure.

In our logistics company, the customer base did not stay constant. Enterprise clients increased. Rural deliveries declined. Urban density rose.

Each segment behaved differently — but leadership never looked. They saw only the aggregate.

If you want a grounding intuition for why this happens, the same structural logic appears in model evaluation errors discussed in train vs test accuracy analysis . Aggregate success hides subgroup failure.

The Hidden Variable: Population Shift

Six months into the initiative, operations optimized routes for dense urban clusters. These deliveries are faster by nature. At the same time, rural routes were deprioritized.

The average delivery time dropped. But:

Urban customers experienced a slight improvement. Rural customers experienced a major decline.

The average masked the redistribution of pain.

This mirrors failures seen in machine learning evaluation, where dataset imbalance creates misleading metrics — a problem explored in precision vs recall tradeoffs .

Aggregation Bias: When Measurement Becomes Policy

Once a metric becomes a target, it stops being a measurement. It becomes a policy instrument.

Teams optimize what is visible. Invisible segments absorb the cost.

Aggregation bias arises when decision-makers assume that aggregate behavior represents individual behavior. This assumption is almost always false.

In our story, regional managers began gaming the system — reclassifying deliveries, rerouting borderline cases, and delaying difficult shipments to protect the average.

The metric improved. Reality did not.

This dynamic is strikingly similar to optimization failures in learning systems, where loss functions drift away from real objectives, as explained in loss function mismatch .

Why Humans Miss This (Even Smart Ones)

Simpson’s paradox is not a “gotcha.” It exploits a deep cognitive habit: we trust summaries more than distributions.

Executives see a number. Engineers see systems. Customers feel experiences.

When those three diverge, the number usually wins — until it is too late.

Visualization helps, but only if it exposes structure. Simple bar charts often hide more than they reveal. Compare this to how distributional insight changes interpretation in series visualization .

From Business Metrics to AI Metrics: Same Disease, New Skin

The same paradox infects machine learning systems. Accuracy improves. Fairness worsens. Robustness declines.

A model optimized for overall accuracy may perform worse for every protected subgroup.

This is not hypothetical. It is mathematically inevitable under imbalance.

The structural parallel is explored in regularization side effects , where global improvements degrade local performance.

One Story, One Failure Mode

Back in logistics, churn data eventually surfaced. When broken down by region, the truth was obvious.

Every region had worsened — except the largest one. The largest region dominated the average.

Leadership had optimized the company into fragility.

This is why Simpson’s paradox is not just statistical trivia. It is a warning label.

Why Dashboards Lie by Default

Dashboards reward simplicity. Reality punishes it.

Every aggregation encodes a choice: what to weight, what to ignore, what to smooth away.

Once smoothed, signals vanish. Edge cases disappear. Failures become invisible.

This invisibility is the most dangerous failure mode of all.

The Only Real Fix: Distributions Over Averages

The company eventually changed its reporting. They replaced single KPIs with segmented distributions.

The illusion collapsed instantly.

Nothing had improved. They had simply learned how not to look.

The same lesson appears repeatedly in technical systems, from clustering evaluation to model diagnostics, as discussed in cluster evaluation pitfalls .

Final Reflection

When a metric improves but reality does not, the metric is not wrong. It is incomplete.

Simpson’s paradox is not a paradox at all. It is the natural consequence of pretending that complex systems can be summarized safely.

The most dangerous words in analytics are not “the model failed.”

They are:

“The numbers look good.”

Tuesday, February 3, 2026

When One Number Replaced Reality

The Average That Lied to Everyone

The Average That Lied to Everyone

Every month, the leadership team at a fast-growing food delivery company gathered around the same slide. It showed a single number in bold, reassuring font:

“Average delivery time: 28 minutes.”

Investors were happy. Marketing loved it. Engineers nodded and moved on. Nothing looked wrong — until customers started leaving.

Complaints told a very different story: some orders arrived in 15 minutes, others in 90. Support teams were overwhelmed. Social media sentiment dropped. Yet the number on the dashboard stayed calm, stable, and convincing.

This is the story of how the average lied — not because math is evil, but because humans kept asking it questions it was never meant to answer.

The Seduction of the Mean

The arithmetic mean is seductive because it feels objective. You add everything up, divide by the count, and receive a single, clean answer. It feels like truth distilled into one number.

But the mean does not describe reality — it summarizes it. And summaries lie when distributions are uneven.

In the delivery company’s case, most orders clustered between 20 and 35 minutes. But a small fraction — delayed by rain, traffic spikes, or staffing shortages — took over an hour.

Those long delays pulled the mean upward just enough to hide the real experience of most customers, a phenomenon deeply connected to skewed distributions, as explained in distribution visualization examples.

Mean vs Median: Two Very Different Stories

When an analyst quietly calculated the median delivery time, the number was shocking:

Median delivery time: 24 minutes.

That meant half of all customers received their food in under 24 minutes — far better than the advertised average. So why were people angry?

Because the median hides pain at the extremes. It ignores how bad the worst cases are.

The mean hid the tail. The median ignored it. Both were incomplete truths.

This distinction mirrors the same logic used in income inequality analysis, where mean income skyrockets while median income stagnates — a statistical illusion explored in aggregate vs individual analysis.

The Shape That Changes Everything: Skewed Distributions

If delivery times followed a neat bell curve, the mean would be reasonable. But real systems are rarely symmetric.

They are skewed — often heavily.

Right skew meant rare but extreme delays dragged the average upward. Left skew would have hidden exceptional performance.

Skewness is not a math detail; it is a signal. Ignoring it is like ignoring turbulence because the plane’s average altitude is stable.

This exact failure appears repeatedly in data analysis, including clustering mistakes discussed in cluster overlap analysis.

Outliers: Noise or Warnings?

Leadership initially labeled the long delays as “outliers.” Someone even suggested removing them from reports.

That would have made the average look fantastic. It also would have destroyed trust.

Outliers are not always noise. Often, they are the only data points telling the truth about system limits.

This is why blindly removing extremes — a common preprocessing mistake — can lead to catastrophic decisions, as shown in outlier removal case studies.

When Averages Shape Policy

The company redesigned staffing based on average demand. But demand spikes did not follow averages. They followed events: rain, holidays, paydays.

Average-based planning under-allocated resources exactly when they were needed most.

This mirrors failures in public systems — from hospital capacity planning to traffic management — where mean-based assumptions collapse under real-world variance.

The same logic is discussed in operational risk analysis in risk modeling frameworks.

The Machine Learning Parallel

The data science team trained a prediction model to minimize mean squared error. It performed excellently — on average.

But worst-case predictions were terrible. Exactly the customers most likely to churn were the ones the model failed.

This is the optimization illusion: minimizing average loss while maximizing real-world damage.

Loss functions behave just like averages — they flatten experience into a single scalar, as explained in loss function trade-offs.

Why Humans Love Averages (and Why That’s Dangerous)

Averages reduce cognitive load. One number is easier to communicate than a distribution.

But simplicity trades accuracy for comfort.

Executives want clarity. Dashboards want symmetry. Slides want bold fonts. Reality refuses all three.

This psychological bias mirrors how people misinterpret probabilities, a theme recurring in decision interpretation errors.

The Moment Everything Broke

A viral post showed a customer waiting 94 minutes for cold food. The average didn’t matter anymore.

The company finally plotted the full distribution. For the first time, everyone saw the long tail.

Silence followed.

What Fixed the System

They stopped asking the average to tell the whole story.

Dashboards now showed:

- Median - 90th percentile - Worst-case scenarios

Staffing was aligned to peaks, not means. Models were evaluated on tail performance.

This shift mirrors best practices in robust modeling discussed in data evaluation strategies.

The Real Lesson

The average did not lie maliciously.

We lied to ourselves by asking it to explain a world shaped by extremes.

Averages are summaries, not guarantees. They describe no one’s actual experience — especially in systems where failure matters more than success.

Final Thought

If one number feels too comforting, it’s probably hiding something.

Saturday, January 11, 2025

Visualizing Titanic Survival Patterns with a Sunburst Chart

Titanic Dataset Sunburst Visualization – Complete Guide

๐Ÿšข Titanic Dataset Visualization Using Sunburst Chart

The Titanic dataset is one of the most widely used datasets in data science. In this guide, we’ll explore how to visualize it using a sunburst chart—a powerful way to understand hierarchical relationships.


๐Ÿ“š Table of Contents


๐Ÿ“Š Dataset Overview

ColumnDescription
classPassenger class (1st, 2nd, 3rd)
sexGender
embark_townBoarding location
survived0 = No, 1 = Yes

๐ŸŒž What is a Sunburst Chart?

A sunburst chart shows hierarchical relationships using concentric circles.

Outer layer → Class Next → Gender Next → Embark Town Inner → Survival

๐Ÿ“ Math Behind the Visualization (Simple)

1. Probability of Survival

\[ P(Survival | Class) = \frac{\text{Survivors in Class}}{\text{Total Passengers in Class}} \]

This tells us survival likelihood for each class.

2. Conditional Probability

\[ P(Survival | Class, Gender) = \frac{\text{Survivors in Group}}{\text{Total in Group}} \]

๐Ÿ‘‰ Example: “What is the survival rate of females in 1st class?”

3. Hierarchical Contribution

\[ Total = \sum_{i} Group_i \]

Each segment size is proportional to its count.


⚙️ Steps to Create Sunburst Chart

  1. Clean dataset
  2. Select relevant columns
  3. Define hierarchy
  4. Generate visualization

๐Ÿ’ป Code Example

import plotly.express as px import pandas as pd df = px.data.titanic() df = df.dropna(subset=['class','sex','embark_town','survived']) fig = px.sunburst( df, path=['class','sex','embark_town','survived'], color='survived', color_continuous_scale='RdBu' ) fig.show()

๐Ÿ–ฅ️ Output

Click to View
Sunburst chart generated successfully.
Interactive visualization opens in browser.

๐Ÿ” Key Insights

  • 1st class passengers had higher survival rates
  • Women survived more than men
  • Cherbourg passengers had slightly better survival
Green = Survived Red = Did Not Survive

๐Ÿ’ก Key Takeaways

  • Sunburst charts simplify complex relationships
  • Hierarchy reveals deeper insights
  • Probability helps interpret visual segments

๐ŸŽฏ Final Thoughts

The sunburst chart transforms raw Titanic data into a meaningful story. It shows not just who survived—but why patterns exist across different groups.

Featured Post

How HMT Watches Lost the Time: A Deep Dive into Disruptive Innovation Blindness in Indian Manufacturing

The Rise and Fall of HMT Watches: A Story of Brand Dominance and Disruptive Innovation Blindness The Rise and Fal...

Popular Posts