← All posts

KSC U17 – Football Data Analysis for Match Preparation

A university project at Hochschule Karlsruhe: turning raw Wyscout exports into automated opponent-analysis reports for the coaching staff of Karlsruher SC U17.

pythonpandasdata-analysisedajupyter

In the summer semester 2026, my teammate Jakob and I did our project work (“Projektarbeit”) in Computer Science at Hochschule Karlsruhe, supervised by Prof. Dr. Patrick Baier. The topic: football data analysis for the U17 team of Karlsruher SC (KSC), which plays in the U17 DFB-Nachwuchsliga.

The match data is licensed and covers real youth players, so the repository is private and this post leaves out detailed numbers and results.

The Problem

The data came from Wyscout, a scouting and analysis platform that records every match. We got Excel exports for six teams of the league, with over 100 metrics per team and match: goals, shots, passes, possession, duels, set pieces and composite metrics like expected goals (xG) and PPDA (passes per defensive action, a measure of pressing intensity).

In that form, the data is hard to use day to day. To prepare for an opponent, the coaches would have to dig through long spreadsheets, find the relevant values and compare them by hand. At the start of the project it wasn’t even clear what useful information was hidden in the data.

Our goal: clean up the raw data, explore it for patterns and outliers, and give the coaching staff a report that shows at a glance where KSC has the edge over a given opponent, and where the opponent does.

What We Built

A pipeline of four Jupyter notebooks, started with a single script, run_pipeline.py, that takes the own team and the opponent:

  1. Preprocessing: merges the Excel exports, removes duplicate matches, maps the messy multi-level column headers to a clean English naming scheme, and converts values like "57%" or "1,8" into numbers.
  2. Feature engineering: derives metrics that make teams comparable regardless of how many actions they had, like shot conversion, save rate, ball recovery rate, attacking style and passing style.
  3. Visualization: radar charts, a head-to-head comparison, a form curve, league rankings and a correlation analysis.
  4. PDF report: puts all charts together into one match report for the coaches.

The script accepts team names from the command line or an interactive menu, matches slightly misspelled names to the right team, and can limit the data to selected teams or a date range. Each notebook is run with papermill, which injects the parameters and saves the executed notebook as a log, so every run can be traced. New steps can be added just by dropping in a notebook that follows the NN_name.ipynb naming scheme.

We deliberately chose descriptive statistics and visualization over machine learning: the dataset was too small to train reliable models, and the results had to be understandable for coaches without a statistics background.

The Report

  • Radar charts (offense, defense, passing) for a quick overall picture of both teams against the league average
  • Head-to-head comparison that only shows the metrics where the two teams clearly differ, and marks who has the advantage
  • Form curve as a rolling three-match points average
  • Rankings that place both teams within the field
  • Correlation analysis of which metrics go along with winning

Exploratory Data Analysis

The EDA turned up a few things we didn’t expect:

  • Selection effect: only six teams were covered with all their matches. Every other team shows up only in games against those six, so their numbers mostly reflect losing to strong teams rather than their real level.
  • Redundant metrics: possession, number of passes and pass accuracy are almost perfectly correlated, as are shots and xG. Showing all of them in one chart gives that aspect of the game extra weight.
  • Outliers are real: some matches have extreme values, like very lopsided scores or teams that barely touched the ball. We kept them, because they reflect what actually happened on the pitch.

What We Learned

  • Data coverage defines what you can say. With only six fully covered teams, statements about a “league average” are hardly reliable. A test showed that changing the comparison basis from all teams to the six fully covered ones changed a large share of the metrics the head-to-head comparison highlighted.
  • Check the provider’s definitions. Wyscout counts throw-ins as set pieces. That made set pieces look like about half of all attacks, and we only noticed it while sanity-checking the data.
  • Normalization is a content decision, not just a technical one. Min-max scaling lets a single extreme team stretch the whole axis. Percentile-based limits, like StatsBomb uses for their radars, or a minimum number of matches per team would be more robust.
  • Correlation isn’t causation. High possession can be a result of leading a game just as much as a cause of it.
  • Notebooks plus papermill work well as a pipeline. Every step stays readable on its own, and a new report is one command away. The weak spot is the position-based column mapping: if Wyscout changes its export format, it has to be updated by hand.

Tech

  • Python 3.12 with pandas and NumPy for cleaning, aggregating and computing metrics
  • openpyxl for reading the Excel exports
  • Matplotlib for all charts
  • Jupyter Notebooks and papermill for the parameterized pipeline
  • fpdf for generating the PDF report
  • Git and GitHub (private repository) for working together

What’s Next

The coaching staff will decide whether the reports actually help them prepare for matches. Possible next steps: a broader data basis covering all teams and more seasons, more robust comparisons, player profiles, and an interactive dashboard in place of the static PDF.

Working with real data from a real club was a great experience. Jakob and I learned that most of the work in data analysis isn’t the charts but understanding where the data comes from and what it can and can’t tell you.