CodeFix Solution

Developer Guides & Code Solutions

Practical tutorials for Python developers. API integrations, machine learning pipelines, and real-world engineering fixes.

Latest Posts

Prediction MarketsQuantPrimer

What Are Prediction Markets and Why Do They Matter? A Developer's Primer

The 40-year history of information aggregation markets, the empirical track record vs experts, and the quant opportunities for a developer who can ship a calibrated model. From Iowa Electronic Markets to Polymarket.

May 18, 2026 · 12 min read
PythonProductionTrading Bots

From Notebook to Production: Shipping Your First Sports Trading Bot

The eight-step playbook for turning a Jupyter prediction model into a live trading service. Persistence, monitoring, supervision, and the production patterns the notebook never taught you.

May 11, 2026 · 13 min read
CalibrationIsotonicSklearn

Calibrating Win-Probability Models: Reliability Curves Using 100,000+ Game-State Snapshots

Build reliability diagrams, compute Expected Calibration Error, fit isotonic and Platt calibrators. Production calibration tutorial in Python with per-sport thresholds.

May 11, 2026 · 14 min read
Feature EngineeringXGBoostSHAP

Feature Engineering for Sports Betting Models: What Actually Moves Win Probability

Which features actually carry signal across NBA, NHL, MLB, and football. The five universal features, the sport-specific add-ons, and the features that look important but are not.

May 11, 2026 · 13 min read
PythonESPNWeb Scraping

Module 1 Deep Dive: Scraping ESPN's Scoreboard Endpoints for Every NBA Game in a Season

Defensive scraping pattern for ESPN's undocumented JSON endpoints. Iterate a full NBA season, handle rate limits and retries, dedup, and save to parquet for downstream ML.

May 11, 2026 · 12 min read
PythonCross-ValidationSports ML

Time-Series Cross-Validation for Sports Models: Why K-Fold Lies

Why random k-fold inflates AUC by 6-15 points on time-ordered sports data. Walk-forward, expanding-window, and season-based CV in Python — plus the label-permutation test that catches deeper leakage.

May 5, 2026 · 14 min read
NCAAMBCalibrationBuyer's Guide

Best College Basketball Prediction Sites 2026: A Calibration-First Buyer's Guide

Developer's buyer's guide to college basketball prediction sources. KenPom, Bart Torvik, 538, ESPN BPI, The Odds API, ZenHodl — ranked by calibration (ECE), transparency, and measured accuracy. No affiliate fluff.

April 22, 2026 · 11 min read
PythonELOXGBoostSoccer

How to Build a Soccer Prediction Model in Python (ELO + XGBoost + Draw Handling)

Full tutorial: soccer-tuned ELO, 3-class win/draw/loss XGBoost with isotonic calibration, league-strength adjustments for Champions League cross-league matches, and Monte Carlo tournament simulator for the 48-team World Cup bracket.

April 22, 2026 · 15 min read
PythonELOMonte CarloNHL

How to Build an NHL Stanley Cup Prediction Model in Python (ELO + Monte Carlo Futures)

Full tutorial: NHL-tuned ELO (K=8, HFA=40), special-teams features (PP%, PK%, save%), best-of-seven Monte Carlo simulator, bracket format (not reseeding), and a 2024-25 playoff backtest harness.

April 22, 2026 · 14 min read
PythonELOXGBoostNBA

How to Build an NBA Finals Prediction Model in Python (ELO + Pace/ORTG/DRTG)

Full tutorial: NBA-tuned ELO (K=20, HFA=80), pace/ORTG/DRTG efficiency priors, XGBoost + isotonic calibration, best-of-seven series Monte Carlo, and a 2024-25 playoff backtest harness.

April 22, 2026 · 14 min read
PythonELOXGBoostMLB

How to Build an MLB Prediction Model in Python (ELO + Starting Pitcher Features)

Full tutorial: MLB-tuned ELO (K=4, HFA=24), starting-pitcher ERA/WHIP/K9 differentials, XGBoost + isotonic calibration, and a 2025 postseason backtest harness (47 games, ECE 1.81%).

April 22, 2026 · 13 min read
PythonELOMonte CarloNFL

How to Build a Super Bowl Prediction Model in Python (ELO + Monte Carlo Futures)

Full tutorial: NFL-tuned ELO, Monte Carlo playoff bracket simulation, neutral-site adjustment for the Super Bowl, and a backtest harness that ran against the actual 2025-26 playoffs (9/13 correct).

April 22, 2026 · 15 min read
PythonXGBoostELOMarch Madness

How to Build a March Madness Prediction Model in Python (With Calibrated Bracket Probabilities)

Full tutorial: ELO ratings with basketball MoV, pace/ORTG/DRTG priors, XGBoost + isotonic calibration, and a tournament backtest harness that runs your model on any past bracket without look-ahead bias.

April 22, 2026 · 14 min read
PythonXGBoostCollege Football

How to Build a College Football Prediction Model in Python (With Calibrated Win Probabilities)

Full tutorial: ESPN play-by-play data, XGBoost training, isotonic calibration, Expected Calibration Error measurement, and backtesting against market win probabilities.

April 22, 2026 · 12 min read
PythonFastAPIMLOps

From Jupyter to Production: Packaging an ML Model for a REST API

Take a scikit-learn or XGBoost model from notebook to production. Pickle versioning, integrity checks, FastAPI endpoints, and graceful fallback — with working code.

April 21, 2026 · 14 min read
PythonXGBoostML Engineering

Sample Weights in XGBoost: Fixing Class Imbalance and Regime Drift

XGBoost's most underused parameter. How to use sample_weight to correct class imbalance, emphasize recent data, and tune for specific regimes.

April 21, 2026 · 12 min read
PythonXGBoostFeature Engineering

Feature Engineering for Sports Win Probability: 15 Features That Actually Matter

The features that make a sports win-probability model work. Score diff, time fraction, Elo, momentum, pace — with Python code for each.

April 21, 2026 · 13 min read
PythonXGBoostCalibration

Calibrating XGBoost Probabilities with Isotonic Regression

Why raw XGBoost predicted probabilities are wrong and how to fix them. Isotonic regression, Platt scaling, and measuring Expected Calibration Error.

April 14, 2026 · 10 min read
PythonAPIML

How to Build a Sports Prediction Model with Python and a Live API

Go from zero to a working sports prediction system in 30 minutes. Live win probabilities, edge detection, and real-time alerts across 10 sports.

April 14, 2026 · 8 min read