(7) – Leveling Up: Surviving Imbalanced Data and Advanced Model Evaluation

Olivier Krieger
23.02.2026 · 3 min read

How to handle rare events, master k-fold cross-validation, and the million-dollar Zillow prize.

Last week, I reached the final instructional module of my Machine Learning Professional Certificate Phase 1: Module 7: Advanced Predictive Performance Evaluation. After learning the basics of how to evaluate a model, this module pushed into the advanced territory of handling real-world, “messy” constraints—specifically, what to do when your data is wildly unbalanced or when you don’t have enough of it.

Here are the key advanced concepts I explored.

1. The Imbalanced Data Dilemma

In the real world, the “class of interest” is often incredibly rare. Think about tax fraud, rare diseases, or system failures. If 99% of transactions are legitimate, a lazy ML model can just predict “Not Fraud” every single time and achieve 99% accuracy—completely missing the point.

Because the cost of a Type II error (False Negative)—like missing an actual fraudulent transaction—is usually much higher than a Type I error (False Positive), we have to force the model to pay attention . We do this through two main techniques:

  • Oversampling: We artificially increase the minority class by randomly duplicating its samples or creating synthetic ones (like SMOTE). The trade-off? You get better detection of the “interesting” cases, but your overall misclassification rate will actually get worse because you’ll trigger more false alarms.
  • Undersampling: We randomly delete samples from the majority class until it balances with the minority. It speeds up training but risks throwing away valuable, informative data.

2. “Having Your Cake and Eating It”: k-Fold Cross-Validation

The standard “Train/Validation/Test” split has a major flaw: the data trade-off dilemma. If you use too much data for training, your validation is unreliable; if you use too much for validation, your model is poorly trained.

The solution is k-fold cross-validation. Instead of one split, you divide your entire dataset into k equal “folds” (usually 5, 7, or 10). The algorithm runs k times. Each time, it trains on k-1 folds and validates on the 1 remaining fold . Finally, you average the scores.

This is a game-changer because every single data point is eventually used for validation, maximizing your data usage without the model ever “seeing” its own validation data during training . The only downside? It’s computationally expensive because you have to train the model multiple times.

3. The $1 Million Zillow Prize

To show the real-world value of squeezing every drop of performance out of a model, we studied the Zillow Kaggle competition. Zillow’s “Zestimate” automatically predicts property selling prices, and they offered $1 million to whoever could improve their algorithm.

The winning team, ChaNJestimate, spent 400 hours combining multiple ML models to reduce the median error rate from 4.5% to just 4.0% . That 0.5 percentage point drop represented a massive 13% improvement in performance—proving that advanced evaluation and tuning are worth their weight in gold.

Conclusion

Module 7 proved that building an ML model isn’t just about feeding data into an algorithm; it’s about actively managing how that algorithm learns. By controlling class balances and maximizing data efficiency through cross-validation, we can build models that actually work in the unpredictable real world.