Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
626 changes: 626 additions & 0 deletions AUDIT_FILE_INVENTORY_2026-10-08.csv

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions AUDIT_NOTES_2026-10-08.md

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ workflow. Settings are editable in the notebook. CSVs in `outputs/expected_point
use the distinct `sofascore_kickbase_points_per_90_odds_lineup` filename label,
preserve optimizer columns, and include the metric and individual source chances.

## Metric consistency reflection

Run `notebooks/09_reflection/05_sofascore_kickbase_metric_consistency.ipynb`
to examine individual SofaScore-derived Kickbase awards over each team's existing
last five matches across competitions. The notebook includes saved inline plots,
position-specific classifications, source coverage, and next-match checks that
recompute form strictly before kickoff. Current form selects the top 20% within
each position using the existing recency-weighted percentile ratings; the percentage,
consistency thresholds, and manual overrides are editable in its configuration cell.
Shared minimum matchday qualification (including latest-match and goalkeeper
exceptions) applies to current players and strictly pre-match cohorts. The matchday
defaults to the source export's value and can be overridden in the notebook.
Form ratings retain the 10-minute minimum and minute groups. Metric consistency
defaults to 45-minute appearances, with actual points and points per 90 shown.
Insufficient samples remain unclassified. No prediction scores are modified.

## Timestamped output retention

Timestamped output exporters invoke the shared cleanup in `project_paths.py`. The
Expand Down Expand Up @@ -116,6 +132,23 @@ Run the automated checks with:
python -m pytest
```

## Upload Kickbase screenshots from a phone

Start the local upload page from PowerShell in the project root:

```powershell
python kickbase_screenshot_intake.py
```

Keep the terminal open. On the same Wi-Fi network, open the `On your phone`
address printed by the app in Android Chrome and enter the displayed PIN. Choose
the matchday, team, and screenshot. The image is saved under
`data/kickbase_lineup_screenshots/md<N>/` using a team-based filename; uploading
again for that team replaces its prior app-uploaded screenshot. The page shows
which fixture teams have an uploaded image. The PIN expires after 30 minutes,
and stopping the app closes the upload page. If Windows Firewall prompts you,
allow access only on your private network.

The existing `.venv` stays at the root because moving a virtual environment can
invalidate absolute paths stored inside it. The browser-backed scraping notebooks
expect a compatible Chrome installation; their current configuration targets
Expand Down
464 changes: 464 additions & 0 deletions archive/md exp pts/md5 exp pts.csv

Large diffs are not rendered by default.

466 changes: 466 additions & 0 deletions archive/md exp pts/md6 exp pts.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions data/reference/player_name_cross_references.csv
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@ ligainsider,union,Frederik Rönnow,7943,Frederik Roennow,2026-09-09T13:43:13+02:
rotowire,bremen,Eren Sami Dinkçi,34269,Eren Dinkci,2026-09-09T13:43:16+02:00
rotowire,schalke,Éric Dina Ebimbe,27879,Eric Junior,2026-09-11T10:09:27+02:00
ligainsider,mainz,Ransford Königsdörffer,23911,Ransford Koenigsdoerffer,2026-09-15T13:51:07+02:00
ligainsider,schalke,Maximilian Wöber,11916,Maximilian Woeber,2026-10-09T16:09:02+02:00
ligainsider,freiburg,Lucas Höler,6593,Lucas Hoeler,2026-10-16T12:24:31+02:00
rotowire,augsburg,Juma Bah,44678,Abdulai Juma Bah,2026-10-16T12:24:37+02:00
31 changes: 31 additions & 0 deletions generate_kickbase_md5.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$teams = @{}
function Add-Team($key,$players) { $teams[$key] = $players }
function P($n,$r,$s,$alts=@()) { ,@($n,$r,$s,$alts) }
Add-Team 'Borussia Dortmund' @(
P 'KOBEL' 1 1; P 'BENSEBAINI' 2 1; P 'ANTON' 2 2; P 'GADOU' 2 3; P 'BEIER' 3 1; P 'NMECHA' 3 2; P 'VEERMAN' 3 3 @('BELLINGHAM'); P 'SVENSSON' 3 4 @('SCHLOTTERBECK'); P 'FÁBIO SILVA' 4 1 @('SABITZER'); P 'GUIRASSY' 4 2; P 'NWANERI' 4 3 @('KARETSAS') )
Add-Team 'SV Werder Bremen' @(P 'HEIN' 1 1 @('SCHLAGER'); P 'DEMAN' 2 1; P 'FRIEDL' 2 2; P 'PIEPER' 2 3; P 'ARTHUR' 2 4; P 'REIS' 3 1; P 'REGEER' 3 2; P 'CHUKI' 3 3; P 'GRÜLL' 4 1; P 'FÜLLKRUG' 4 2; P 'DINKCI' 4 3)
Add-Team '1. FC Union Berlin' @(P 'RÖNNOW' 1 1; P 'ROTHE' 2 1; P 'UDUOKHAI' 2 2; P 'QUERFELD' 2 3; P 'VAN DEN BOSCH' 2 4 @('JURANOVIĆ'); P 'KHEDIRA' 3 1; P 'HABERER' 3 2 @('KEMLEIN'); P 'IMERI' 4 1 @('SCHÄFER'); P 'JEONG' 4 2 @('BURCU'); P 'AEBISCHER' 4 3; P 'LATTE LATH' 5 1 @('SKARKE'))
Add-Team 'SV 07 Elversberg' @(P 'KRISTOF' 1 1; P 'GÜNTHER' 2 1; P 'ROHR' 2 2; P 'PINCKERT' 2 3; P 'GYAMERAH' 2 4 @('SIRCH'); P 'POREBA' 3 1; P 'KEIDEL' 3 2; P 'CAMPBELL' 4 1; P 'DARVICH' 4 2 @('ONYЕKA/KRATTENMACHER'); P 'PETKOV' 4 3; P 'MOKWA' 5 1 @('FUTKEU'))
Add-Team '1. FSV Mainz 05' @(P 'SCHWOLOW' 1 1; P 'MWENE' 2 1; P 'POTULSKI' 2 2; P 'GRUBER' 2 3; P 'POSCH' 2 4; P 'CACI' 2 5; P 'LEE' 3 1 @('MARTEL'); P 'SANO' 3 2; P 'AMIRI' 3 3; P 'TIETZ' 4 1; P 'BECKER' 4 2)
Add-Team 'Bayer 04 Leverkusen' @(P 'FLEKKEN' 1 1; P 'GUTIÉRREZ' 2 1; P 'MEDINA' 2 2; P 'TAPSOBA' 2 3; P 'QUANSAH' 2 4; P 'GARCÍA' 3 1; P 'FERNÁNDEZ' 3 2; P 'MOREIRA' 4 1; P 'MAZA' 4 2 @('TILLMAN'); P 'DIABY' 4 3; P 'SCHICK' 5 1)
Add-Team 'FC Augsburg' @(P 'DAHMEN' 1 1; P 'BEHRENS' 2 1; P 'RIEDER' 2 2; P 'MASSENGO' 2 3; P 'FELLHAUER' 2 4; P 'BRACKELMANN' 3 1; P 'GOUWELEEUW' 3 2 @('BAH'); P 'MATSIMA' 3 3; P 'CLAUDE-MAURICE' 4 1 @('KÖMÜR'); P 'IBRAHIMOVIĆ' 4 2 @('KADE/WOLF'); P 'GREGORITSCH' 5 1)
Add-Team 'FC Bayern München' @(P 'NEUER' 1 1; P 'DAVIES' 2 1 @('BROWN'); P 'TAH' 2 2; P 'UPAMECANO' 2 3; P 'LAIMER' 2 4 @('STANIŠIĆ'); P 'PAVLOVIĆ' 3 1; P 'KIMMICH' 3 2; P 'DÍAZ' 4 1; P 'SAIBARI' 4 2 @('KARL/GNABRY'); P 'OLISE' 4 3; P 'KANE' 5 1)
Add-Team 'SC Paderborn 07' @(P 'NOLL' 1 1; P 'SCHELLER' 2 1; P 'GÖTZE' 2 2 @('HANSEN'); P 'TER HORST' 2 3; P 'OBERMAIR' 3 1; P 'VIDOVIĆ' 3 2; P 'ULRICH' 3 3; P 'CURDA' 3 4; P 'CASTAÑEDA' 4 1; P 'MARINO' 5 1; P 'PIERINGER' 5 2)
Add-Team 'VfB Stuttgart' @(P 'SEIMEN' 1 1 @('BREDLOW'); P 'MITTELSTÄDT' 2 1; P 'CHABOT' 2 2; P 'JELTSCH' 2 3; P 'VAGNOMAN' 2 4; P 'FÜHRICH' 3 1; P 'STILLER' 3 2; P 'PRÖMEL' 3 3; P 'EL KHANNOUSS' 4 1 @('LEWELING/HENDRIKS'); P 'DEMIROVIĆ' 4 2 @('PEJČINOVIĆ'); P 'UNDAV' 4 3)
Add-Team 'TSG Hoffenheim' @(P 'BAUMANN' 1 1; P 'ROTS' 2 1 @('HAJDARI'); P 'MACHIDA' 2 2; P 'KABAK' 2 3; P 'COUFAL' 2 4 @('GENDREY'); P 'BURGER' 3 1; P 'AVDULLAHU' 3 2; P 'DAGHIM' 4 1; P 'LEMPERLE' 4 2; P 'HLOŽEK' 4 3 @('ASLLANI'); P 'CONTÉ' 4 4 @('WIMMER'))
Add-Team 'Hamburger SV' @(P 'HEUER FERNANDES' 1 1; P 'TORUNARIGHA' 2 1; P 'BORNAUW' 2 2; P 'CAPALDO' 2 3; P 'MØLLER WOLFE' 3 1; P 'SAMBI LOKONGA' 3 2; P 'REMBERG' 3 3; P 'EL OUAHDI' 3 4; P 'ADELINE' 4 1; P 'POULSEN' 4 2 @('STANGE'); P 'VIEIRA' 4 3)
Add-Team 'RB Leipzig' @(P 'VANDEVOORT' 1 1; P 'RAUM' 2 1; P 'CASTELLO JR.' 2 2 @('ESTÈVE'); P 'ORBÁN' 2 3; P 'BAKU' 2 4 @('HENRICHS'); P 'EL AYNAOUI' 3 1; P 'SEIWALD' 3 2 @('BANZUZI'); P 'NUSA' 4 1; P 'NKUNKU' 4 2; P 'RÖMULO' 4 3 @('MAKSIMOVIĆ'); P 'GOMIS' 4 4 @('GRUDA'))
Add-Team 'Eintracht Frankfurt' @(P 'ATUBOLU' 1 1; P 'BRASSIER' 2 1; P 'KOCH' 2 2; P 'COLLINS' 2 3; P 'KOSUGI' 3 1; P 'ONYEDIKA' 3 2; P 'ASÉKO' 3 3 @('HØJLUND'); P 'KNAUFF' 3 4 @('BAUM'); P 'UZUN' 4 1 @('EBNOUTALIB'); P 'BURKARDT' 4 2; P 'DOAN' 4 3)
Add-Team '1. FC Köln' @(P 'SCHWÄBE' 1 1; P 'MENSAH' 2 1; P 'LOCHOSHVILI' 2 2; P 'SIMPSON-PUSEY' 2 3; P 'SEBULONSEN' 2 4; P 'KRAUSS' 3 1; P 'SKHIRI' 3 2; P 'EL MALA' 4 1; P 'MOORE' 4 2; P 'MAINA' 4 3; P 'BÜLTER' 5 1 @('THIELMANN'))
Add-Team "Borussia M'gladbach" @(P 'NICOLAS' 1 1; P 'DIKS' 2 1; P 'LESZCZYŃSKI' 2 2 @('NEUHAUS'); P 'ITAKURA' 2 3; P 'HEROLD' 3 1 @('ULLRICH'); P 'STÖGER' 3 2 @('NGUEFACK'); P 'SANDER' 3 3; P 'KONOPLIA' 3 4 @('HASHIOKA/SCALLY'); P 'BOLIN' 4 1 @('MOHYA/HACK'); P 'KLEINDIENST' 5 1; P 'MACHINO' 5 2 @('LIDBERG'))
Add-Team 'SC Freiburg' @(P 'BACKHAUS' 1 1; P 'MAKENGO' 2 1 @('GÜNTER'); P 'LIENHART' 2 2; P 'GINTER' 2 3; P 'TREU' 2 4; P 'ENGELHARDT' 3 1; P 'EGGESTEIN' 3 2; P 'SCHERHANT' 4 1; P 'SUZUKI' 4 2; P 'BESTE' 4 3; P 'MATANOVIĆ' 5 1)
Add-Team 'FC Schalke 04' @(P 'KARIUS' 1 1; P 'GOSENS' 2 1; P 'EL FAOUZI' 2 2; P 'TANAKA' 2 3 @('SCHALLENBERG'); P 'DINA EBIMBE' 2 4; P 'KURUCAY' 3 1; P 'KATIĆ' 3 2; P 'T. BECKER' 3 3; P 'AOUCHICHE' 4 1; P 'SYLLA' 4 2 @('HWANG/ADAMU'); P 'KARAMAN' 4 3)
$fixtures = @(
@('FR 20:30','Borussia Dortmund','SV Werder Bremen'), @('SA 15:30','1. FC Union Berlin','SV 07 Elversberg'), @('SA 15:30','1. FSV Mainz 05','Bayer 04 Leverkusen'), @('SA 15:30','FC Augsburg','FC Bayern München'), @('SA 15:30','SC Paderborn 07','VfB Stuttgart'), @('SA 15:30','TSG Hoffenheim','Hamburger SV'), @('SA 18:30','RB Leipzig','Eintracht Frankfurt'), @('SO 15:30','1. FC Köln',"Borussia M'gladbach"), @('SO 17:30','SC Freiburg','FC Schalke 04')
)
function Obj($x,$rank,$side) { $shown=$x[0]; if($shown -match '^ONY'){$shown='ONYEKA'}; [ordered]@{full_name=$null;displayed_name=$shown;position=$null;injury_status=$null;player_id=$null;player_url=$null;formation_row=[int]$x[1];slot_index=[int]$x[2];starting_probability_rank=$rank} }
$all=@(); $primary=0; $total=0
foreach($f in $fixtures){ $m=[ordered]@{match_time=$f[0]}; foreach($side in @('home','away')) { $name=if($side -eq 'home'){$f[1]}else{$f[2]}; $arr=@(); foreach($x in $teams[$name]) { $arr += Obj $x 1 $side; $primary++; $total++; $rank=2; foreach($a in $x[3]) { foreach($part in ($a -split '/')) { $arr += Obj @($part.Trim(),$x[1],$x[2]) $rank $side; $rank++; $total++ } } }; $m[$side]=[ordered]@{team_name=$name;side=$side;lineup_status='Predicted Lineup';players=$arr} }; $all += $m }
$stamp=Get-Date -Format 'yyyyMMdd_HHmmss'; $iso=(Get-Date).ToString('yyyy-MM-ddTHH:mm:sszzz'); $outDir='outputs/kickbase/predicted_lineups'; New-Item -ItemType Directory -Force -Path $outDir | Out-Null
$doc=[ordered]@{metadata=[ordered]@{source='Kickbase';source_type='user-submitted screenshots';matchday=5;player_identity_policy='displayed_name_only';captured_at=$null;processed_at=$iso;screenshot_count=18;match_count=9;team_count=18;primary_player_count=$primary;player_count=$total;fixture_reference='outputs/sofascore/match_ids/match_ids_5.json';transcription_note='Only text visibly displayed in the submitted Kickbase screenshots is stored for player identity. Repeated replacement candidates are stored for every visible competing slot.'};matches=$all}
$path=Join-Path $outDir "kickbase_bundesliga_lineups_$stamp.json"; $doc | ConvertTo-Json -Depth 10 | Set-Content -Encoding utf8 $path; Write-Output $path
Loading
Loading