
The Problem Data scientists write exploratory Jupyter notebooks to test ideas fast. That's exactly what notebooks are for: quick, iterative, single-use code. But when that code needs to become a real service that other applications can call, a serious gap opens up. Notebooks are built to answer "does this run once, right now, on my machine," not "will this work correctly, every time, for someone else, in production." Bugs that never show up in a notebook, because the same fixed dataset happens to hide them, can silently break or silently return wrong answers the moment that code runs in the real world. This notebook-to-production gap is a well known, expensive problem. Teams either skip production hardening entirely and ship fragile services, or spend hours manually rewriting notebooks by hand. Our Solution We built Legacy Notebook Modernizer, a system where IBM Bob IDE analyzes a messy legacy notebook, identifies concrete production blocking bugs, and refactors it into a tested, deployable FastAPI service, all while preserving the original model's exact logic and behavior. We tested this across three real Kaggle notebooks of increasing complexity, from 5 cells to 35 cells, single model to 22 model ensembles. Bob consistently caught genuine, non obvious bugs, not just style issues: A data leakage bug, where pd.get_dummies() was applied independently to training and test data. This works fine by coincidence in a notebook, since both files happen to contain the same categories, but it would silently misalign every single live API request. That's exactly the kind of bug that only shows up in production. A silent logic bug, where a missing assignment left every passenger over 64 with a wrong feature value, and no error was ever raised. A misleading accuracy claim, where a "99% accuracy" notebook defined a proper train and test split but never actually used it. Every model was secretly evaluated on data it had already seen. We then fully refactored one notebook into a production grade service. The leakage bug was fixed with a single scikit learn Pipeline that combines the encoder and the model, fit once so they always stay aligned. We added an honest 80/20 train and validation split, full input validation, structured error handling, and 18 passing automated tests. It's deployed live and publicly testable right now. Who this is for, and why it's creative: Our target users are data science teams and ML engineers who need to move models from experimentation to production quickly, without silently shipping bugs that only show up once real traffic hits them. Most "notebook cleaner" tools just reformat code so it looks nicer. Ours is different: it demonstrates Bob catching bugs that change what the model actually does, and fixing them with real engineering practices, pipelines, tests, and a validated API. That difference between style and behavior is what makes this genuinely useful instead of just cosmetic.
27 Sep 2026