TLDRocket
Sign in

Simpler Experimentation with Jupyter, Papermill, and MLflow

Eugene Yan

A data scientist shares a workflow fix for messy ML experiments using Jupyter, Papermill, and MLflow. No more copy-pasted notebooks or hunting for which chart matches which result.

Based on reporting by Eugene Yan — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Anyone who's built more than one ML pipeline in Jupyter knows the drill. You get a notebook working for one case — say, fraud detection in a single country — and then you need to run it five more times for five more countries. The lazy move is to duplicate the notebook and rename it. It works, until you find a feature that improves results and now you're copy-pasting that fix into five separate files, praying you didn't miss one.

Eugene Yan's writeup lays out a cleaner path using three tools that already exist and don't require abandoning notebooks at all. Papermill handles the parameterization problem: tag a single cell in your notebook as "parameters," then feed it different values — INDEX = GOLD, INDEX = NIKKEI, whatever — and Papermill spits out a fully executed, self-contained notebook for each run. No duplication, no manual renaming, no drift between copies. In his demo, a single basic.ipynb pipeline predicting next-day moves in the S&P 500 gets rerun against Gold, the Shanghai Composite, the Hang Seng, and the Nikkei with one small loop.

That solves the code-duplication headache, but it creates a new one: now you've got a pile of notebooks, each stuffed with metrics, ROC curves, and model binaries, and matching them up by hand is its own kind of tedious. That's where MLflow comes in. A few lines — log_param, log_metric, log_artifact — inside the training loop push everything into MLflow's tracking server, and suddenly you've got a dashboard where you can sort five models across five indices by AUC, filter down to just logistic regression runs, and click through to download the exact chart or pickle file tied to that run.

The example itself is intentionally throwaway — predicting whether the S&P 500 closes up or down tomorrow using moving averages isn't going to fund anyone's retirement, and Yan admits the features are highly correlated and the stats aren't rigorous. But that's not really the point. The point is the plumbing: three lightweight, already-popular tools stitched together so that scaling from one experiment to a hundred doesn't multiply your manual bookkeeping by a hundred too.

What's appealing here is how unglamorous the fix is. No new framework to learn from scratch, no rewriting notebooks as scripts, no vendor lock-in. Just Papermill for execution and MLflow for logging, wrapped around the notebook habits people already have. For teams running the same modeling pattern across countries, segments, or product lines — which is most teams doing applied ML — this is the kind of workflow tweak that saves real hours without anyone needing to change how they think about their code.

My take — AI-written commentary, not fact-checked reporting

I like this piece because it's refreshingly free of hype — no new model, no benchmark chest-thumping, just someone admitting notebooks get messy and fixing it with boring, reliable tools. This is the unsexy infrastructure work that actually determines whether ML teams ship or drown in duplicated .ipynb files, and it deserves way more attention than the next foundation model announcement.

Read more about this at: Eugene Yan

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.