Downloads · 30 days
0
addweb-solution/la-liga-score-predictor
la-liga-score-predictor is a tabular classification model from addweb-solution. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. It is set up for catboost. The card lists the license as mit.
This is a public football prediction bundle for Spanish La Liga.
Downloads · 30 days
0
Access
Public
Updated Apr 30, 2026
Repo size
664 KB
Likes
0
Public
Click a slice to open those files.
.cbm1.3 MB · 88%
From the Hugging Face model README
This is a public football prediction bundle for Spanish La Liga.
It is built for simple pre-match score prediction from structured historical match data.
Public package version:
2026.04.1Scope:
It does not include:
This release is strongest as:
It is not positioned as:
The simplest way to think about it is:
This bundle ships:
This bundle does not ship:
That means:
predict_match(...) still needs compatible historical match dataFor real upcoming-match prediction, users must supply compatible historical match data so the feature builder can compute pre-match context.
home goalsaway goalsscorelinehome / draw / away probabilitiesconfidence levelconfidence scoreconfidence marginabstain / score-range signals for fragile matcheshome_team, away_team, and match_date when a compatible history CSV is availableThe trained model uses 48 numeric signals at inference time.
Those 48 signals do not mean your history CSV must literally contain 48 raw columns.
In the public package, those signals come from a mix of:
That means:
The public Python package exposes these main methods:
predict_match(home_team, away_team, match_date)Typical fields returned:
model_versionexpected_home_goalsexpected_away_goalspredicted_home_goalspredicted_away_goalspredicted_scoreresult_probabilitiesraw_result_probabilitiesconfidence_levelconfidence_scoreconfidence_marginabstain_recommendedpredicted_score_range when triggereddecoder_diagnosticsrequestpredict_match_simple(home_team, away_team, match_date)Typical fields returned:
model_versionpredicted_home_goalspredicted_away_goalspredicted_scoreresult_probabilitiesconfidence_levelconfidence_scoreconfidence_marginabstain_recommendedpredicted_score_range when triggeredrequestpredict_features(features)Typical fields returned:
model_versionexpected_home_goalsexpected_away_goalspredicted_home_goalspredicted_away_goalspredicted_scoreresult_probabilitiesraw_result_probabilitiesconfidence_levelconfidence_scoreconfidence_marginabstain_recommendedpredicted_score_range when triggereddecoder_diagnosticspredict_features_simple(features)Typical fields returned:
model_versionpredicted_home_goalspredicted_away_goalspredicted_scoreresult_probabilitiesconfidence_levelconfidence_scoreconfidence_marginabstain_recommendedpredicted_score_range when triggered
README.md
LICENSE
CHANGELOG.md
RELEASE_GUIDE.md
MODEL_CARD.md
EVALUATION_SUMMARY.md
DATA_FORMAT.md
FAQ.md
QUICK_PUBLISH_CHECKLIST.md
ARTIFACTS_SHA256.txt
requirements.txt
pyproject.toml
sample_history.csv
sample_fixtures.csv
predict_one.py
predict_batch.py
demo_cli.py
smoke_test.py
demo_notebook.ipynb
la_liga_score_predictor/
__init__.py
predictor.py
feature_builder.py
artifacts/
la_liga_score_predictor.json
home_goals_model.cbm
away_goals_model.cbm
outcome_model.cbm
From inside ``:
python3 -m venv .venv
source .venv/bin/activate
pip install .
If you prefer, the dependency list is also available in requirements.txt.
This bundle includes an expanded synthetic sample_history.csv so the wrapper can be demonstrated without private data.
The included sample now provides:
120 synthetic historical match rows20 Spanish La Liga team names35 CSV columnsIt is still:
From inside ``:
PYTHONPATH=. python3 predict_one.py
Expected result style:
From inside ``:
PYTHONPATH=. python3 predict_batch.py
cat predictions_output.csv
From inside ``:
PYTHONPATH=. python3 smoke_test.py
This confirms that:
From inside ``:
PYTHONPATH=. python3 demo_cli.py \
--home-team 'Girona FC' \
--away-team 'Mallorca' \
--match-date '2026-05-01' \
--dataset-csv sample_history.csv \
--pretty
A notebook starter is included for Kaggle or local notebook use:
demo_notebook.ipynb
The easiest interface is:
from la_liga_score_predictor import LaLigaScorePredictor
predictor = LaLigaScorePredictor.from_defaults(
dataset_csv_path="sample_history.csv"
)
result = predictor.predict_match(
home_team="Athletic",
away_team="Osasuna",
match_date="2026-04-21",
)
print(result["predicted_score"])
print(result["result_probabilities"])
print(result["confidence_level"])
For a real application, the cleanest usage pattern is:
predict_match(...) for upcoming fixturesKeep expectations clear:
At a practical level, a strong history CSV should provide:
predict_match(...) will failIn short:
If you only want the product-facing fields, use:
simple_result = predictor.predict_match_simple(
home_team="Athletic",
away_team="Osasuna",
match_date="2026-04-21",
)
For real usage, replace sample_history.csv with your own compatible historical match CSV:
from la_liga_score_predictor import LaLigaScorePredictor
predictor = LaLigaScorePredictor.from_defaults(
dataset_csv_path="/path/to/your/history.csv"
)
result = predictor.predict_match(
home_team="Real Madrid",
away_team="Valencia",
match_date="2026-05-10",
)
The same smaller response shape is available here too:
simple_result = predictor.predict_match_simple(
home_team="Real Madrid",
away_team="Valencia",
match_date="2026-05-10",
)
If you already have the numeric features, use the lower-level interface:
from la_liga_score_predictor import LaLigaScorePredictor
predictor = LaLigaScorePredictor.from_defaults()
features = {
"home_avg_goals_last5_all": 1.4,
"away_avg_goals_last5_all": 1.1,
"home_avg_goals_last5_home": 1.6,
"away_avg_goals_last5_away": 1.0,
"home_avg_conceded_last5_all": 0.9,
"away_avg_conceded_last5_all": 1.2,
"home_avg_conceded_last5_home": 0.8,
"away_avg_conceded_last5_away": 1.3,
"home_win_rate_last10_all": 0.5,
"away_win_rate_last10_all": 0.4,
"home_win_rate_last10_home": 0.6,
"away_win_rate_last10_away": 0.3,
"home_draw_rate_last10": 0.2,
"away_draw_rate_last10": 0.3,
"home_goal_diff_last5": 2.0,
"away_goal_diff_last5": -1.0,
"home_rest_days": 6.0,
"away_rest_days": 5.0,
"home_elo_pre": 1715.0,
"away_elo_pre": 1662.0,
"elo_diff_pre": 53.0,
"home_team_id": 12.0,
"away_team_id": 19.0,
"home_player_minutes_total_prev5": 4050.0,
"away_player_minutes_total_prev5": 3970.0,
"home_player_goals_total_prev5": 6.0,
"away_player_goals_total_prev5": 4.0,
"home_player_assists_total_prev5": 4.0,
"away_player_assists_total_prev5": 3.0,
"home_player_yellow_cards_total_prev5": 8.0,
"away_player_yellow_cards_total_prev5": 10.0,
"home_player_red_cards_total_prev5": 0.0,
"away_player_red_cards_total_prev5": 0.0,
"home_player_starters_count_prev5": 55.0,
"away_player_starters_count_prev5": 55.0,
"home_player_used_count_prev5": 76.0,
"away_player_used_count_prev5": 73.0,
"home_player_injured_count_prev5": 1.0,
"away_player_injured_count_prev5": 2.0,
"home_player_suspended_count_prev5": 0.0,
"away_player_suspended_count_prev5": 1.0,
"home_tactic_id": 4.0,
"away_tactic_id": 7.0,
"home_coach_id": 1012.0,
"away_coach_id": 1048.0,
"home_tactic_stability_last5": 0.8,
"away_tactic_stability_last5": 0.4,
"tactic_matchup_code": 4007.0,
}
result = predictor.predict_features(features)
print(result["predicted_score"])
For a smaller response:
simple_result = predictor.predict_features_simple(features)
print(simple_result)
predict_match()For predict_match(home_team, away_team, match_date) to work, the predictor needs a compatible historical match CSV.
Minimum required columns:
datehome_teamaway_teamhome_goalsaway_goalsBetter results if your CSV also includes:
If advanced columns are missing, the wrapper falls back to dataset-level defaults. That keeps the interface runnable, but prediction quality may be weaker than the full training environment.
Typical output:
{
"predicted_score": "1-0",
"result_probabilities": {
"home_win": 0.46,
"draw": 0.31,
"away_win": 0.23
},
"confidence_level": "medium",
"confidence_score": 0.46,
"confidence_margin": 0.15,
"abstain_recommended": false
}
For most web or mobile products, the main fields to show are:
predicted_scoreresult_probabilitiesconfidence_levelabstain_recommendedpredicted_score_range when presentThe helper methods for this are:
predict_match_simple(...)predict_features_simple(...)Advanced fields are also returned for developers and power users:
expected_home_goalsexpected_away_goalsconfidence_scoreconfidence_marginraw_result_probabilitiesdecoder_diagnosticsRecommended product approach:
predicted_score
predicted_home_goals
predicted_away_goals
result_probabilities
home_win, draw, and away_winraw_result_probabilities
expected_home_goals
expected_away_goals
confidence_level
high, medium, or lowconfidence_score
confidence_margin
abstain_recommended
true when the fixture is fragile enough that an exact-score claim should be treated cautiouslypredicted_score_range
decoder_diagnostics
top_outcome
top_outcome_probability
second_outcome_probability
draw_probability
xg_delta
expected_home_goals - expected_away_goalsclose_call_draw_override
true when a near-tied outcome distribution and small expected-goal gap push the decoder toward a drawoutcome_enforced
true when the outcome model is strong enough that the decoder forces the final score to match that directionspecialist_rule_triggered
true when an internal score-adjustment rule firesspecialist_rule_name
request
home_team, away_team, and match_date used in predict_match()predict_match("Athletic", "Osasuna", "2026-04-21")predict_match("Girona FC", "Real Betis", "2026-04-21")predict_match("Mallorca", "Valencia", "2026-04-21")This bundle ships the model artifact:
la_liga_score_predictorThis bundle ships the public package version:
2026.04.1Planned public cadence:
MODEL_CARD.mdRELEASE_GUIDE.mdEVALUATION_SUMMARY.mdDATA_FORMAT.mdFAQ.mdQUICK_PUBLISH_CHECKLIST.mdCHANGELOG.mdARTIFACTS_SHA256.txt