Sign in

iiinova is part of the Atmosphere — an open, public network where you own your identity.

Martin Eastwood

@martineastwood.co.uk
2K followers 120 following 62 posts

Somewhere in the middle of a Venn diagram of machine learning and football / soccer. www.pena.lt/y/blog.html

PostsRepliesMedia
Martin Eastwood @martineastwood.co.uk · 28/02/2026
🚀 penaltyblog v1.9.0 is live! 🐍⚽️ New in this version: ✅ create_dixon_coles_grid(): Use lambdas from external ML models. ✅ goal_expectancy_extended(): Infer rho/lambdas from odds. 🛠️ Improved quarter lines (2.25/2.75) logic for totals market. ⚡️ More optimisations to FootballProbabilityGrid
A Python code snippet demonstrating the new 'create_dixon_coles_grid' function in the penaltyblog library. The code shows how to initialize a probability grid using expected goals (lambdas) for the home and away teams, and then calculate home win probabilities, over/under 2.5 goal totals, and Asian Handicaps directly from that grid.
090 9
Martin Eastwood @martineastwood.co.uk · 08/01/2026
Why build a custom MCMC sampler from scratch? In my latest blog post, I dig into the "why" and the "how". From the decision to drop heavy dependencies like Stan for this use case, to using Cython for speed, and how to interpret those "fuzzy caterpillar" plots. Read it here: pena.lt/y/2026/01/08...
A technical MCMC Trace Plot with two horizontal subplots labeled "attack_Arsenal" and "home_advantage." Each plot shows four overlapping colored lines (Chains 0 to 3) creating a dense, horizontal "fuzzy caterpillar" shape. This visualization indicates that the Bayesian model has successfully converged and is stable across 2,000 iterations.
120 2
Martin Eastwood @martineastwood.co.uk · 08/01/2026
Bayesian goal models are back in penaltyblog v1.8.0 - and this time, they’re dependency-free! ⚽️📈
A dark-themed code editor window showing Python code using the penaltyblog library. It demonstrates initializing a HierarchicalBayesianGoalModel with home/away goals and teams, fitting the model using MCMC sampling with parameters like 2000 samples and 4 chains, and finally predicting match probabilities for an Arsenal vs. Manchester City fixture
1133 13
Martin Eastwood @martineastwood.co.uk · 09/12/2025
⚽ penaltyblog v1.7.0 is now available: Direct integration with the Opta (Stats Perform) API. You can now stream matches & events lazily without downloading the JSON first. Includes helpers for human-readable filtering (no more memorising IDs). pip install --upgrade penaltyblog
Code example showing how the penaltyblog python package can now integrate directly with the StatsPerform Opta API to download data directly.
160 6
Martin Eastwood @martineastwood.co.uk · 07/10/2025
We can also split Massey Ratings into attack & defence: 🔴 LFC: best attack in the league paired with a mid-table defence ⚪️ ARS: Elite at both ends. They have the #1 defence and the #3 attack 🌳 Forest: A disaster at both ends of the pitch
0101 10
Martin Eastwood @martineastwood.co.uk · 07/10/2025
Here's how the Premier League table really looks according to Massey Ratings, which account for strength of schedule. 📈 Arsenal (+1.5) & Man City (+1.3) are clear strongest overall 😬 Man Utd (-0.2) rank in the bottom half 📉 West Ham & Forest (-1.2) are worst teams by far
Massey Ratings for the English Premier League
3144 14
Martin Eastwood @martineastwood.co.uk · 15/08/2025
🔍 New: Flow Query DSL Filter datasets with safe, Pythonic expressions: - AST-parsed (no eval) - Variables, regex, dates - Access nested fields
Image of code showing examples of penaltyblog Flow's new DSL
100 1
Martin Eastwood @martineastwood.co.uk · 15/08/2025
📈 Goal models are now 5-10× faster - Cython-powered analytical gradients for speed + stability - Fine-tune with minimizer_options:
Image of code demonstrating the the features in penaltyblog's goals models
110 1
Martin Eastwood @martineastwood.co.uk · 15/08/2025
⚽ New: Pitch Plotting API Build interactive football visualisations with: - Multiple layouts & themes - Scatter, heatmaps, arrows, comets - Custom hover tooltips
GIF demonstrating the interactive tooltips in penaltyblog's new Pitch plotting API
100 1
Martin Eastwood @martineastwood.co.uk · 25/05/2025
At the heart of matchflow is the Flow class - a lazy, composable way to work with nested football data. You can filter, group, and summarize JSON-like data without flattening or loading everything into memory. 👇 Example:
Python code showing how to use the Flow class from penaltyblog.matchflow: it loads a folder of JSON files, filters for shots, groups by player name, and summarizes shot counts.
110 1