An interactive series on judging models: confusion matrices, precision and recall, ROC and PR curves, agreement between models, calibration, thresholds, imbalance, confidence intervals, t-tests, test set size, leak-free splits and regression metrics.
Posted on October 12, 2026
A classifier can be right in two ways and wrong in two ways, and a confusion matrix counts all four. Part 1 of the evaluation metrics series walks through the four bins, the threshold that fills them, and what changes past two classes, with three live 3D figures you can turn and tune.
Read more Posted on October 12, 2026
Recall reads across a row. Precision reads down a column. F1 weighs the two together. Part 2 of the evaluation metrics series reads them off the same 100 emails and the same threshold slider, then extends them to more than two classes with macro and micro averaging.
Read more Posted on October 12, 2026
Each threshold gives one confusion matrix. Sweep every threshold and the matrices trace a curve. Part 3 of the evaluation metrics series builds the ROC and precision-recall curves from the same 100 emails, and shows which area to report and when.
Read more Posted on October 12, 2026
Correlation is not agreement. Part 4 of the evaluation metrics series compares a spam model with a smaller, cheaper one on the same 100 emails, using the bias between them and their limits of agreement to decide whether one can stand in for the other.
Read more Posted on October 13, 2026
Two models can agree on most emails just by both saying not spam. Part 5 of the evaluation metrics series counts how often the part 1 model and a cheaper model give the same label, subtracts the agreement chance alone would give, and shows the prevalence trap, how to read the number, and kappa for more than two labels.
Read more Posted on October 13, 2026
A model is calibrated when its probabilities come true at the rate they claim. Part 6 of the evaluation metrics series draws the reliability diagram for the same 100 emails, scores it with expected calibration error (ECE) and the Brier score, shows why good ranking is not good calibration, and fixes it with Platt scaling.
Read more Posted on October 13, 2026
Every threshold trades one mistake for the other. Part 7 of the evaluation metrics series puts a price on false positives and false negatives and finds the threshold that costs least, compares it with the rule for calibrated models, Youden's J and the highest F1, and explains why the threshold is chosen on validation data, not the test set.
Read more Posted on October 13, 2026
When spam gets rare, accuracy flatters. Part 8 of the evaluation metrics series makes spam rarer and rarer for the same model and tracks accuracy, balanced accuracy, the Matthews correlation coefficient (MCC) and F1, shows a model that never flags anything scoring 99% accuracy, and explains which question each number answers.
Read more Posted on October 13, 2026
A confidence interval is a range, computed from your data, that is likely to contain the true value of what you measured. Part 9 of the evaluation metrics series defines it and its building blocks, then computes it for the same 100 emails two ways: by resampling the test set 1,000 times (the bootstrap), and with a formula for accuracy, with a Wilson-interval calculator. It also separates test-set uncertainty from training-seed variation, compares two models with a paired bootstrap, and shows how to report each.
Read more Posted on October 13, 2026
Three tests, one idea: a difference divided by its noise. Part 10 of the evaluation metrics series runs the one-sample, paired and two-sample (Welch) t-tests on the series' model scores, shows what goes wrong when paired data gets the two-sample test, and covers the assumptions and the rank-based alternatives.
Read more Posted on October 13, 2026
Enough that the reported number is precise enough to make the decision, and no fewer. Part 11 of the evaluation metrics series writes the requirement first, then sizes the test set from the margin of error, from statistical power for a pass-or-fail target, and from the rule of three when no failures are expected, and shows why every subgroup needs its own count.
Read more Posted on October 13, 2026
Every number in the series assumes the test emails were never seen while the model was built. Part 12 of the evaluation metrics series gives training, validation and test sets one job each, runs k-fold, leave-one-group-out and nested cross-validation, and shows how near-copies from the same sender leak across a random split.
Read more Posted on October 12, 2026
A regression model predicts a number, so every prediction is off by some amount. Part 13 of the evaluation metrics series scores a model estimating heart ejection fraction for 100 patients with bias, MAE, MSE, RMSE, MAPE, R², explained variance, Pearson and Spearman correlation and Lin's concordance, and shows why correlation is not R².
Read more Models built step by step, with live plots and code written by hand in NumPy: activation functions, loss functions and logistic regression.
Posted on October 12, 2026
A neuron adds its inputs into one number, and the activation function decides what comes out. Part 1 of machine learning from scratch plots eleven of them, from sigmoid and tanh to ReLU, GELU, SiLU and softmax, showing what each maps to what, where it is used, and why some make gradients vanish.
Read more Posted on October 12, 2026
Training makes the loss small, so the loss decides what the model learns. Part 2 of machine learning from scratch plots 23 of them: binary and multiclass cross-entropy, focal, hinge and Dice; mean squared error (MSE), mean absolute error (MAE), Huber, quantile and Poisson for regression; and contrastive and InfoNCE losses for embeddings. Each shows its gradient, where it is used, and which summary of the data it makes the model predict.
Read more Posted on October 12, 2026
Logistic regression turns a weighted sum of features into a probability with a sigmoid, and learns its weights by gradient descent on log loss. Part 3 of machine learning from scratch builds it in four steps with live plots, derives the gradient p − y, writes the model in NumPy, runs it on two clusters and on breast cancer data, and checks it against scikit-learn.
Read more Posted on October 12, 2026
Logistic regression for more than two classes: one score per class, a softmax to turn them into probabilities, and the same p − y gradient. Part 4 of machine learning from scratch shows the decision regions with draggable weights, derives the softmax gradient, trains the model from scratch with mini-batches on MNIST handwritten digits, and compares it with scikit-learn.
Read more Interactive benches for the core patterns, with the cost of every operation: arrays, linked lists, recursion, sorting, binary search, trees, backtracking, heaps, hashing, graphs, dynamic programming, sliding windows, two pointers, prefix sums, fast and slow pointers, tries, bit manipulation and primes.
Posted on October 12, 2026
One row of memory, and what each move on it costs. Part 1 of Algorithms and Data Structures runs array operations on an interactive bench: O(1) access by index, O(n) inserts that shift every neighbour, a dynamic array doubling when it fills up, and stacks, with two LeetCode examples played step by step.
Read more Posted on October 12, 2026
Nodes scattered in memory, held together by pointers. Part 2 of Algorithms and Data Structures runs every linked list operation on an interactive bench, counting hops and pointer writes, compares singly and doubly linked lists, and plays reversing a list and merging two sorted lists step by step.
Read more Posted on October 12, 2026
A recursive call goes down to a base case, then comes back up, handing each answer to the call waiting for it. Part 3 of Algorithms and Data Structures steps through factorial, Fibonacci and memoized Fibonacci with a live call stack and call tree, and shows why plain Fibonacci is O(2ⁿ) while memoization makes it O(n).
Read more Posted on October 12, 2026
Four ways to put things in order, and what each one costs. Part 4 of Algorithms and Data Structures steps through insertion, merge, quick and bucket sort on an interactive bench, counting comparisons and moves, shows where n log n comes from and what stable means, and plays Sort Colors and Merge Intervals from LeetCode.
Read more Posted on October 12, 2026
Check the middle, throw away the half that cannot hold the answer. Part 5 of Algorithms and Data Structures runs binary search on a sorted array and on a range of possible answers, shows why 16 candidates need at most 5 checks and a million need 20, and plays Koko Eating Bananas and First Bad Version from LeetCode.
Read more Posted on October 13, 2026
A tree is a board of gates: every node has at most two children. Part 6 of Algorithms and Data Structures walks a binary search tree depth first and breadth first, searches it down a single path, reads it in sorted order, compares the space DFS and BFS need, and plays Validate BST and Right Side View from LeetCode.
Read more Posted on October 13, 2026
Choose, explore, un-choose. Part 7 of Algorithms and Data Structures walks a tree maze to show how backtracking keeps a trail and undoes its last choice at a dead end, draws the decision tree it explores, and plays Subsets and Permutations from LeetCode.
Read more Posted on October 13, 2026
The smallest value is always on top. Part 8 of Algorithms and Data Structures stores a min heap as a plain list, steps through heapify in O(n) and push and pop in O(log n), builds a max heap by negating values, and plays Kth Largest Element and Last Stone Weight from LeetCode.
Read more Posted on October 13, 2026
A hash function sends each key straight to its slot, so a lookup needs no search. Part 9 of Algorithms and Data Structures counts frequencies with a map, finds a duplicate with a set, solves Two Sum in one pass, shows why collisions keep the average cost at O(1), and plays Valid Anagram and Longest Consecutive Sequence from LeetCode.
Read more Posted on October 13, 2026
A graph is a tree with the rules loosened: no root, and paths that can loop back. Part 10 of Algorithms and Data Structures counts islands with DFS on a grid, builds an adjacency list, finds the fewest steps with BFS, keeps a visit set against loops, and plays Rotting Oranges and Course Schedule from LeetCode.
Read more Posted on October 13, 2026
Recursion whose subproblems overlap, solved once each. Part 11 of Algorithms and Data Structures fills a ledger bottom-up for climbing stairs and unique paths, keeps only the last values or the last row each step reads, and plays House Robber and Longest Common Subsequence from LeetCode.
Read more Posted on October 13, 2026
A window over contiguous elements whose two edges only ever move forward. Part 12 of Algorithms and Data Structures slides a fixed-size window, grows and shrinks a variable one to find the longest run without repeats, runs Kadane's algorithm for the maximum subarray, and plays Minimum Size Subarray Sum and Best Time to Buy and Sell Stock from LeetCode.
Read more Posted on October 13, 2026
Two indexes start at opposite ends and close in. Part 13 of Algorithms and Data Structures shows why sorted order tells you which pointer to move, finds a pair with a given sum and checks a palindrome, and plays Container With Most Water and 3Sum from LeetCode.
Read more Posted on October 13, 2026
Precompute running totals once, and any range sum is a single subtraction. Part 14 of Algorithms and Data Structures builds a prefix array, answers range queries in O(1), counts subarrays that sum to k with a hash map of prefixes, and plays Find Pivot Index and Product of Array Except Self from LeetCode.
Read more Posted on October 13, 2026
Slow moves one node per turn, fast moves two. Part 15 of Algorithms and Data Structures detects a cycle with Floyd's algorithm and finds the middle of a list in O(n) time and O(1) space, and plays Linked List Cycle II and Find the Duplicate Number from LeetCode.
Read more Posted on October 13, 2026
Words that start the same share a path. Part 16 of Algorithms and Data Structures inserts words into a trie one character per level, looks up words and prefixes by walking down from the root, and plays Add and Search Words and Longest Common Prefix from LeetCode.
Read more Posted on October 13, 2026
Every integer is a row of switches. Part 17 of Algorithms and Data Structures counts set bits with shifts, finds the single number by cancelling pairs with XOR, steps through AND, OR, XOR and the shifts, and plays Power of Two and Missing Number from LeetCode.
Read more Posted on October 13, 2026
To test one number, try divisors only up to its square root. This extra part of Algorithms and Data Structures checks a prime in O(√n), finds every prime up to n with the Sieve of Eratosthenes, and plays Count Primes and Closest Prime Numbers in Range from LeetCode.
Read more Large language models (LLMs) in practice: fine-tuning with LoRA and parameter-efficient methods, and models that return decisions instead of text.
Posted on September 19, 2026
TypeSafe AI has released Jev, which it calls the first System One model. Instead of generating text for a person to read, it evaluates typed questions against a state and returns structured decisions with calibrated probabilities. Here is what that means, how it differs from an LLM, and why calibration is the part that matters most for automation.
Read more Posted on December 17, 2025
Parameter efficient fine tuning adapts large language models to specific tasks without retraining all weights. By training only a small set of parameters, tools like Unsloth make LoRA and DoRA practical on a single GPU or Google Colab.
Read more Courses shared with a password.
Posted on October 18, 2026
Password required.
Read more Writing on music, and what it carries.
Posted on December 15, 2025
Pneuma is one of Tool’s most deliberate songs: a meditation on breath, consciousness and unity, built on hypnotic rhythm and restraint. Its message is simple. Beneath identity and flesh, we share the same breath.
Read more