Challenges in the calibration of tree-based models for imbalanced classification
This paper demonstrates that analytically calibrating tree-based models trained on undersampled imbalanced data leads to unreliable prevalence estimates and unexpected biases, arguing instead for the use of learning-based calibration methods like beta calibration.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Picture: The "Recipe" Problem
Imagine you are a chef trying to learn how to make a perfect soup. However, your kitchen is incredibly unbalanced: you have 10,000 potatoes but only 10 carrots. If you try to learn the recipe by tasting a bowl that has 10,000 potatoes and 10 carrots, you will never learn what a carrot tastes like. You'll think the soup is 99.9% potato.
To fix this, you decide to undersample. You throw away most of the potatoes so you have a bowl with 50 potatoes and 10 carrots. Now, your training data is balanced, and you can learn the recipe better.
The Catch: When you finally cook the soup for the real world (where there are actually 10,000 potatoes), your taste buds are still used to the balanced bowl. You think the soup is 50% carrots, but in reality, it's still 99.9% potato. Your predictions are "biased."
The Old Fix: The "Math Formula"
For a long time, data scientists used a specific math formula (Equation 1 in the paper) to fix this. The idea was simple: "We know we threw away 90% of the potatoes. Let's just multiply our prediction by a number to mathematically 'add them back'."
The authors of this paper say: "Stop doing that."
They found that this math formula doesn't work well for Tree-Based Models (like Random Forests). Instead of fixing the soup, the formula makes the taste wildly unpredictable.
The Two Main Problems Discovered
1. The "Knob" Problem (Number of Predictors)
Imagine your Random Forest is a team of 500 detectives trying to solve a mystery.
- The Rule: At every step, the detectives can only look at a certain number of clues (predictors) to decide which way to go.
- The Experiment: The authors turned a "clue knob." Sometimes they let the detectives look at just 2 clues. Sometimes they let them look at 15 clues.
What happened?
When they used the old math formula to fix the bias, the final answer changed drastically depending on how many clues the detectives were allowed to look at.
- If they looked at 2 clues, the model predicted 100 fires.
- If they looked at 15 clues, the model predicted 140 fires.
The Analogy: It's like asking a group of people to guess the weight of a watermelon. If you tell them to only look at the color, they guess 10 lbs. If you tell them to look at the color, the stem, the sound when tapped, and the texture, they guess 15 lbs.
In a perfect world, the math formula should have corrected these guesses so they all landed on the same true weight. But instead, the formula made the guesses drift further apart. The more clues the detectives used, the more the final estimate jumped up.
2. The "Surprising Bias" (Sampling Rate)
Usually, we think that if you have too few "minority" items (like the 10 carrots), the model will ignore them and guess too low.
- The Old Belief: "Decision trees ignore the minority class."
- The Paper's Discovery: In their experiments, the decision trees actually did the opposite! They overestimated the minority class.
The Analogy: Imagine you are trying to guess how many red marbles are in a jar of 1,000 marbles (990 blue, 10 red). You take a small sample.
- Expected: You might guess "maybe 1 or 2 red marbles" (underestimating).
- What the Trees Did: The trees looked at the sample and said, "Wow, red marbles are everywhere! I bet there are 50 red marbles!"
The authors found that as they changed the sampling rate (how many potatoes they threw away), the model's overestimation got worse. The math formula tried to fix this, but because the tree was already guessing too high, the formula just made the final result even more chaotic.
The Real-World Example: Wildfires
The authors tested this with real data about wildfires in Alberta, Canada.
- Wildfires are rare (like the carrots).
- They used the "math formula" to fix the models.
- The Result: Depending on how they set the "clue knob" (number of predictors) or how they sampled the data, the model predicted the number of future fires could vary by 40%.
- Why this matters: If a government agency uses these models to decide where to send fire trucks, they might send too many trucks to one area and none to another, simply because they tweaked a setting in the computer code.
The Conclusion
The paper concludes that the "math formula" (analytical calibration) is a broken tool for this specific job. It creates a situation where:
- Changing a setting (like the number of clues) changes the answer, even though the answer shouldn't change.
- The models sometimes guess the minority class is more common than it actually is, which the formula fails to fix.
The Solution: Instead of using a rigid math formula, the authors suggest using "learning" methods (like Beta Calibration). Think of this as hiring a taste-tester who actually tastes the final soup and learns how to adjust the seasoning, rather than trying to calculate the adjustment with a calculator.
Summary in One Sentence
Using a simple math formula to fix "unbalanced" data in tree-based models doesn't work; it makes the predictions wildly unstable and sometimes causes the model to overestimate rare events, so we need smarter, learning-based ways to fix the bias instead.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.