About

About Fit Lab

Fit Lab explains the machine learning algorithms used on well logs by letting you do each job by hand first, then watching the algorithm do the same job, one step at a time, on the same samples.

How a chapter works

Each chapter starts with a subsurface question rather than an algorithm: can the logs find the facies on their own, how well does porosity predict permeability, which samples are bad hole. Then:

The wells

Most figures use six synthetic wells, built from the rock physics in Probe Lab, so the true facies, porosity and permeability are known at every depth. That's what lets the lab show where a model was right and wrong, not just its score. The wells have the problems real wells have, on purpose: noise, a washout, a missing sonic, a well logged with older tools, a rock harder than any in the others, and beds thinner than the tools can see. More about the data.

The algorithms

Every algorithm is written for the lab, small enough that each step can be drawn: no machine learning library runs in your browser. Each one is checked against scikit-learn, the Python library most readers will use. Where no randomness is involved (k-means from the same start, linear regression, k-nearest neighbours, decision trees and every metric) the lab gives scikit-learn's answers. Where it is (random forests, neural networks, isolation forests), the lab's results fall within the spread scikit-learn gives over ten random seeds. The Assumptions page lists every difference.

The workbench and challenges

The workbench puts the algorithms, wells and settings on one screen, so you can try combinations no chapter shows; the whole setup lives in the address, so you can share it. The challenges are short "beat the algorithm" puzzles, one for each of the main lessons.

Your settings

The Aa menu in the top bar sets the theme (light, dark, or whatever your device uses) and the text size. Those settings, the chapters you've read and your challenge bests are kept in your browser only, and the lab works fully without them. Pages are counted anonymously with GoatCounter, as across the rest of the site.

Inspired by

The Labs series was inspired by Ryan Sael's The Plane of Focus, an interactive lens lab that explains camera focus by letting you turn the focus ring and watch the sharp plane move. Fit Lab also owes a great deal to explainers that make algorithms visible: R2D3's A visual introduction to machine learning, MLU-Explain, Bartosz Ciechanowski's articles, the TensorFlow Playground, Naftali Harris's Visualizing K-Means Clustering, Seeing Theory and Distill.

Made by Andy McDonald. What's changed.

© 2026 Andy McDonald. All rights reserved. The code, figures, text and synthetic wells in Fit Lab may not be copied, republished or reused without written permission. You are welcome to link to it and quote short excerpts with credit. Rights and third-party notices.