/sports-analytics-core:market-vs-modelfrom SportsDataHQ: analytics core
Converts betting odds to probabilities, removes margin, and compares model probabilities against market prices. Reports the gap and whether the model's view is statistically significant.
Ships in SportsDataHQ: analytics core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turn prices into probabilities, then compare the probability our model gives an outcome with the probability the market implies. This skill reports how the two differ and whether the model's view tends to be right. It does not tell anyone to wager and it does not size stakes. Odds are information.
| Need | Tool (any sport server that offers it) |
|---|---|
| Market probability, implied and fair (no-margin), averaged across books | get_game_probabilities, get_prop_probabilities |
| Prices by book | get_odds |
| Opening to closing movement | get_line_movement, get_prop_movement |
| Period and alternate markets | get_market_odds, get_alt_lines |
| How a kind of prop did against the market, with sample size and interval | get_prop_backtest |
| Our model's probability | the sport's prediction tool (for hockey, get_predictions), or the user's own file |
Examples by sport: hockey get_game_probabilities for an NHL game, basketball get_game_probabilities for an NBA game, soccer get_game_probabilities for home/draw/away, tennis and UFC get_odds for the two-way moneyline, golf get_winner_odds for majors.
Not every tool exists on every server. If a tool is missing, say so and use the closest one listed in that server's tool notes. Do not invent tools such as get_ev or get_clv.
User-supplied files: require game_id, model_prob, and market odds (American or decimal). Check model probabilities are in [0, 1] and sum to about 1 per game. Warn if they were not calibrated (see probability-calibration), because gaps from uncalibrated probabilities are unreliable.
Use this part alone when the question is only about what a price means.
American -> decimal: +150 -> 150/100 + 1 = 2.50 -180 -> 100/180 + 1 = 1.556
Decimal -> American: 2.50 -> (2.50 - 1) * 100 = +150 1.556 -> -100 / 0.556 = -180
American -> fractional: +150 -> 3/2 -180 -> 5/9
Raw implied probability (margin included):
positive American: 100 / (american + 100) +150 -> 0.400
negative American: abs(a) / (abs(a) + 100) -180 -> 0.643
decimal: 1 / decimal
On a two-way market the raw probabilities sum to more than 1.
total_implied = raw_home + raw_away
margin = total_implied - 1.0
Example: Sabres +150 / Leafs -180 gives 0.400 + 0.643 = 1.043, a 4.3% margin. Typical ranges: main moneylines 3-6%, main totals 4-5%, player props 7-12%.
Divide each raw probability by the total. Fast, assumes the margin is spread proportionally.
fair_i = raw_i / total_implied
Find exponent k so that the sum of raw_i^(1/k) equals 1 (numerical solve, for example scipy.optimize.brentq). Better than multiplicative on lopsided markets.
Models a share z of informed money. Solve for z, then compute fair probabilities.
import math
from scipy.optimize import brentq
def shin_gap(z, raw):
return sum(p**2 / (z + (1 - z) * p) for p in raw) - 1
z = brentq(shin_gap, 0, 0.5, args=(raw_probs,))
fair = [(math.sqrt(z**2 + 4 * (1 - z) * p**2) - z) / (2 * (1 - z)) for p in raw_probs]
Works for three-way markets with three raw probabilities. Check that the result sums to 1. Preferred for research and for comparison with a model.
Put all the margin on one side. Gives a bound, not an estimate.
| Method | Use | Accuracy |
|---|---|---|
| Multiplicative | Quick check, balanced markets | Moderate |
| Power | Heavy favorites | Good |
| Shin | Research, model comparison | Best with several books |
| Worst case | Bounds only | Conservative |
Default: Shin. If the sport server offers get_game_probabilities, use its fair probability and say that is where it came from.
Sabres +150 / Leafs -180: raw 40.0% / 64.3% (total 104.3%).
| Method | Sabres | Leafs |
|---|---|---|
| Multiplicative | 38.4% | 61.7% |
| Power | 38.5% | 61.5% |
| Shin | 38.3% | 61.7% |
| Raw | 40.0% | 64.3% |
Comparing a model against raw probabilities would compare it with a number inflated by the margin. Always use fair probability.
Convert a fair probability back to American odds:
fair_prob > 0.5: -100 * p / (1 - p)
fair_prob < 0.5: +100 * (1 - p) / p
Fair 38.3% gives +161 / -161. A posted +150 is the price with the margin built in.
Pull opening and closing prices with get_line_movement. Report the move in fair probability points, not just in American odds, because the same cents mean different things at different prices. Movement has many causes (injury news, lineup news, volume, repositioning). Describe it, with the time and the books involved; do not claim a cause unless a tool result shows it. Lack of movement is no information.
Convert each price to implied probability, then remove the margin to get the fair probability (see Odds math above). Prefer the fair probability from get_game_probabilities, which averages across books. Show both the raw implied and the fair number.
gap = model_prob - market_fair_prob # in percentage points
Report per outcome: model probability, market fair probability, gap. A positive gap means our model rates the outcome higher than the market does.
Read gaps with care:
Sort games by absolute gap. Present as "where our model differs most from the market", with the likely reason (rest, starter, injuries) taken from tool output. Frame it as a list of disagreements to investigate, not a list of things to do.
The closing line is the market's best final estimate. If the model's probabilities move toward the closing fair probability more often than away from it, the model is picking up real information.
# for each prediction: model_prob, open_fair, close_fair
moved_toward_model = (abs(close_fair - model_prob) < abs(open_fair - model_prob))
share = moved_toward_model.mean()
Pull get_line_movement for opening and closing prices. Report the share, the sample size and an interval. Sustained movement toward the model over 100+ predictions is a good sign. Near 50% means the model adds little beyond the market. Consistently away means the market knows something the model does not.
Also compare log loss or Brier score of the model against the market's closing fair probability on the same games (see prediction-tracker and backtesting). The market is a hard benchmark; matching it is a good result.
At small samples, apparent differences are noise. For a hit rate p over n predictions, the 95% interval is about p +/- 1.96 * sqrt(p(1-p)/n). With n = 40 that is roughly 15 points wide each way at p = 0.5. Do not call a pattern real unless the interval excludes the benchmark. For historical tests, use get_prop_backtest where it exists: report its sample size, interval and by_season breakdown, and say that a past result is not a forecast.
| Rationalization | Why it is wrong | Do this instead |
|---|---|---|
| "The model says 65% and the market says 55%, so the model found something" | A 10-point gap is usually a calibration or input error | Check calibration and lineup information first |
| "The line has not moved, so the market agrees with us" | No movement is silence, not agreement | Treat movement as signal and absence of movement as no information |
| "Our hit rate is 60%" | A rate without sample size and odds context says little | Report n, interval, and the market's own rate on the same games |
| "One book differs, so the model is right" | A single book can be stale | Compare to the cross-book fair probability |
| "Recent results confirm the gap" | Small samples mislead | Report by-season results and the interval |
| "Use the raw implied probability" | It includes the margin | Remove the margin first |
| "Multiplicative is fine on a heavy favorite" | It diverges from Shin by 1-2 points at -300 and beyond | Use Shin or the cross-book fair probability |
| "Props have the same margin as moneylines" | Props carry 7-12% | Compute the margin from the two sides each time |
| "The line moved, so informed money did it" | Movement has many causes | Describe the move; do not assign a cause without evidence |
Odds question only:
Game: [Away] at [Home] Book: [name] Source: get_odds
Raw odds: [A] +150 / [B] -180
Raw implied: 40.0% / 64.3% (total 104.3%, margin 4.3%)
Fair (Shin): 38.3% / 61.7% No-margin line: +161 / -161
Model against the market:
MODEL VS MARKET: [Date] (season convention: [..])
[Home] vs [Away]
Our probability: [X.X%] (source: [tool or file])
Market, implied: [X.X%] (get_odds, [book])
Market, fair: [X.X%] (get_game_probabilities)
Gap (model - market): [+/-X.X points]
Context: [injury, starter, rest notes from tools]
SLATE SUMMARY
Games compared: N Median absolute gap: X.X points
Largest gaps: [list]
| Finding | Next skill |
|---|---|
| Probabilities look off | probability-calibration |
| Want to log predictions and grade them | prediction-tracker |
| Want historical validation | backtesting |
| Hockey slate view | nhl-daily-slate |
| Current prices across books (hockey) | nhl-odds-explorer |
| Odds term unclear | docs/market-glossary.md |
What SKILL.md sets; muted values are Claude Code's defaults
9 plugins ship this exact skill · first indexed Dec 3, 2026
Showing 6 of 9 plugins, one per repository first
Other plugins' skills for the same job
10 skills in this plugin
/backtestingUse when the user asks whether a sports model or system would have worked in the past, for any sport, in plain wording: 'does my model actually work', 'test it on the last three seasons', 'did it beat the closing line', 'is it still as accurate as it used to be', 'what is the confidence interval on my hit rate', 'how would this have done in 2023', 'run it against past odds', 'is this edge real or luck', 'how should I split seasons to test it'. Use this whenever historical performance, fold design, sample size or an interval is the question. Load this skill first, before calling any data tool; it says which tools to call. Walk-forward only; refuses k-fold and in-sample testing; reports sample size, an interval and a per-season breakdown. Not for logging live predictions as games finish (see prediction-tracker), tonight's gap to the market (see market-vs-model) or training (see model-building)./data-pipelineUse when the user wants anything sports-related to run on its own or keeps getting numbers that do not line up: 'run my model every morning', 'schedule a script to grab results daily', 'GitHub Action to refresh my ratings', 'automate the whole thing', 'email me when the model gets worse', 'where do I store predictions', 'I joined two tables and lost rows', 'duplicate rows in my data', 'does this date belong to last season'. Load this skill first, before calling any data tool; it says which tools to call. Covers cron jobs and GitHub Actions, storage, model versioning, retraining and drift alerts, plus the data checks other skills point to (ids, season convention per sport, one league, duplicates, sample-size floors). Not for one-off lookups (call your sport's tools directly), building the model (use model-building), historical testing (use backtesting) or grading logged predictions (use prediction-tracker).npx claudepluginhub sports-data-hq/sportsdatahq-skills --plugin sports-analytics-core