# Mapping Dutch Democracy: Building a Political Compass from 28,000 Parliamentary Votes

What if you could take every motion voted on in the Dutch Parliament over the past decade and automatically plot parties and MPs on a political map — with zero manual labeling?

That's exactly what this project does. Here's how I built it, what I had to solve along the way, and what it revealed about Dutch political dynamics.

## The Starting Point: Open Data, Hidden Structure

The Dutch Parliament publishes every vote — every motie, every amendement, every besluit — in an open OData API. We're talking over 28,000 distinct motions spanning 2016 to 2026, each with a record of how every individual MP voted: voor (for), tegen (against), onthouden (abstained), or afwezig (absent). That's over 500,000 individual vote records.

A note on the numbers: The 28,000 figure counts distinct parliamentary decisions (motions, amendments, legislative proposals). The 500,000+ figure counts individual MP votes — each motion generates roughly 18 vote records (one per voting MP or party bloc). At ~3,000–4,000 motions per year and 70–80 parliamentary sitting days, that's roughly 50 votes per sitting day. The Dutch Second Chamber is prolific.

This is an extraordinary dataset. But in raw form it's just a table of votes. The interesting question is: can we extract structure — left vs. right, progressive vs. conservative, governing vs. opposition — purely from the pattern of who votes with whom?

The answer is yes, and the method is surprisingly elegant.

## Step 1: Turning Votes into Geometry

Each motion is a snapshot of political alignment. For each motion, we know which MPs voted together and which voted apart. If every PvdA and GroenLinks MP votes the same way almost every time, that tells us something. If PVV and CDA MPs diverge consistently, that tells us something too.

I represent this with Singular Value Decomposition (SVD) on the MP × motion matrix:

- Rows: individual MPs (and party actors for collective votes)
- Columns: motions
- Values: +1 (voor), −1 (tegen), 0 (absent/abstain)

SVD finds the dominant axes of variation — the directions along which the chamber disagrees most. The first component almost always corresponds to a left-right axis. The second typically captures something like progressive-traditionalist or libertarian-authoritarian. The key point: the axes emerge from the math, not from any labeling on my part.

### Making Windows Comparable: Procrustes Alignment

Running SVD independently per time window creates a subtle problem: SVD axes are arbitrarily oriented. The "left-right" axis from 2020-Q3 and the "left-right" axis from 2021-Q1 might point in completely different directions — even if the underlying politics barely changed. You can't just stack the coordinates and call it a trajectory.

The fix is Procrustes alignment: given two sets of party/MP positions across consecutive windows, find the rotation matrix R that best maps one onto the other (minimizing the Frobenius norm of the difference), using MPs who appear in both windows as anchors:

    R = argmin_R ||A − B @ R||_F,  subject to R'R = I

This is solved cleanly via SVD of the cross-covariance matrix (a nice piece of mathematical symmetry — SVD to build the space, SVD to align it). The result: a continuous track for every party from 2019 to 2026, where position changes reflect genuine political movement rather than axis flips.

## Step 2: Finding Similar Motions

Once we have SVD vectors for every motion in a window, we can find the most politically similar motions. Two motions are close if they produce a similar split in the chamber — same parties voting the same way.

The similarity computation is pure NumPy: load all SVD vectors for a window, L2-normalize, compute cosine similarity via a single matrix multiply, then extract top-k neighbors. For a 4,000-motion quarter, that's a 4000×4000 matrix — fast enough without batching.

## The Numbers: What We're Working With

Year | Motions | Breakdown
--- | --- | ---
2016 | 162 | Mostly legislative proposals (data incomplete)
2017 | 126 | Mostly legislative proposals (data incomplete)
2018 | 124 | Mostly legislative proposals (data incomplete)
2019 | 3,374 | 2,058 moties + 350 amendementen
2020 | 4,223 | 3,141 moties + 354 amendementen
2021 | 4,283 | 3,395 moties + 236 amendementen
2022 | 4,115 | 3,255 moties + 290 amendementen
2023 | 3,272 | 2,557 moties + 217 amendementen
2024 | 3,965 | 3,007 moties + 359 amendementen
2025 | 3,712 | 2,900 moties + 251 amendementen
2026 | 948 | 849 moties + 21 amendementen (partial year)

Early years (2016–2018) are incomplete — the API data for this period is sparse and mostly contains legislative proposals rather than parliamentary motions. From 2019 onwards, the data is comprehensive, running quarterly for 41 time windows in total.

The 2022 spike is striking. Over 4,000 motions in a single year — this was when the Rutte IV coalition governed amid intense debates on energy prices, housing, the war in Ukraine, and the ongoing nitrogen crisis. 2023 culminated in the November election that brought PVV to its historic first-place finish with 37 seats.

## Finding 1: The Merger That Was Already Written in the Votes

The GroenLinks–PvdA merger wasn't a surprise to the data. In the raw SVD vectors, they appear as separate parties from 2019 through 2023 — but their coordinates were already converging. By late 2022, the distance between them was smaller than the internal variation within most other parties. By 2023-Q3 — the last quarter before the formal merger — GroenLinks and PvdA agreed on 99.8% of recorded votes.

The raw data preserves the distinction carefully. From 2019 through mid-2023, the `svd_vectors` table lists GroenLinks and PvdA as separate entries per window. From late 2023 onwards — when the merger formally took effect in parliament — a single GroenLinks-PvdA entity appears. The pipeline tracks this faithfully: you can literally watch two separate points on the political compass drift together and then merge into one.

What's striking is how early the convergence is visible. By 2021 — two full years before the merger announcement — GroenLinks and PvdA coordinates in the SVD space are nearly overlapping. At the individual MP level, there was occasional divergence on defense and security votes (GroenLinks MPs pulling slightly away from the PvdA centroid), but at the party level they were practically indistinguishable.

This created an interesting pipeline challenge: the party normalization step has a mapping that folds both names into `GroenLinks-PvdA` across the entire dataset. For the post-merger period that's correct; for the pre-merger period it's a simplification that hides the convergence story. The raw vectors still capture it — you just have to know to look.

After the formal merger, GroenLinks-PvdA became one of the most cohesive parties in parliament. Their internal voting discipline rivals SGP and ChristenUnie — near-perfect blocs. VVD, by contrast, shows the most internal variation, which tracks with what you'd expect from a large centrist party managing conflicting wings.

## Finding 2: When Left and Right Unite Against the Center

The most surprising pattern in the data isn't left vs. right — it's left and right vs. the governing coalition.

During the Rutte IV cabinet (2022–2023), a recurring pattern emerged: PVV, FvD, and JA21 (right-wing) would vote with SP, GroenLinks-PvdA, PvdD, DENK, and Volt (left-wing) against the governing parties VVD, D66, CDA, and ChristenUnie. This isn't a one-off — it happened on dozens of motions.

The topics tell the story:

- Disability care bureaucracy — motions to reduce administrative burden in disability care. The populist right and the progressive left both opposed the coalition's market-oriented approach.
- Respite care for intensive caregivers — same coalition of radical left and radical right, opposing centrist fiscal restraint.
- Anti-fraud budget retention — the coalition wanted to maintain the anti-fraud apparatus (think: the toeslagenaffaire aftermath); both flanks pushed back.
- Education funding — motions to increase fundamental education budgets. VVD and D66 voted against; PVV and SP voted together.
- Regional infrastructure — train stations, Eindhoven connectivity, regional investment. Left+right voted for; coalition voted against.

This is the classic "horseshoe" pattern in political science — the extremes converging against the center — but it's remarkable to see it so clearly in the voting geometry. It's not ideological agreement between left and right; it's a shared opposition to the governing consensus.

## Finding 3: BBB's Geometric Arrival

When BBB (BoerBurgerBeweging) entered parliament after the 2023 provincial elections, their SVD position placed them between PVV and CDA — consistent with their policy profile: agrarian-nationalist populism with Catholic-provincial roots. New parties don't get to pick their geometric location; the voting record places them. That BBB landed exactly where you'd expect is a good validity check.

What the geometry also shows: BBB started close to PVV on the nationalist axis, but drifted toward the CDA cluster over their first year in parliament — visible as a curved trajectory rather than a fixed point.

## Finding 4: The Closest Votes in a Decade

The controversy score (`1 − winning_margin`) reveals the knife-edge votes. In the current fragmented parliament, the tightest split is a perfect 8–8 party-line tie — decided by the chamber chair's casting vote. These happened on:

- Family reunification for AMV status holders (Boomsma motion, 2025) — immigration policy at its most contested
- Nuclear weapons and NATO (Dobbe motion, 2025) — whether to push for nuclear disarmament within the alliance
- Long COVID research funding (Kostic motion, 2025) — healthcare commitments that split parties along unexpected lines
- Cormorant population management (Kostic motion, 2025) — agricultural vs. ecological interests in a literal bird-counting exercise

The narrowest non-tie votes are razor-thin too: Wilders' asylum emergency stop motion lost by the slimmest margin (5 parties for, 16 tied — effectively blocked), while Marijnissen's motion against private equity in GP practices nearly flipped the other way (16 for, 5 tied). On a different day, a different MP showing up, Dutch immigration and healthcare policy could have shifted.

More broadly, over 15,000 motions had winning margins below 55% — these are the genuinely contested decisions, not the rubber stamps. At the other extreme, about 3,700 motions passed with 95%+ support: the uncontroversial consensus items that rarely make headlines.

## The Pipeline Architecture

Single DuckDB database, modular Python pipeline, no cloud infrastructure:

    API (Tweede Kamer OData)
      → download_past_year.py        → motions table (28,304 rows)

    motions
      → extract_mp_votes.py          → mp_votes table (508,765 rows)
      → sync_motion_content.py       → body_text enrichment (~94% coverage)
      → svd_pipeline.py              → svd_vectors table (73,165 rows, 41 windows)

    svd_vectors
      → similarity/compute.py        → similarity_cache (top-10 per window)

The similarity computation is pure NumPy: load all SVD vectors for a window, pad to uniform length, L2-normalize, compute the full cosine similarity matrix via a single matrix multiply, then extract top-k neighbors. For a 4,000-motion quarter, that's a 4000×4000 matrix operation — fast enough that batching isn't needed.

The database sits at ~18 GB on disk — the full parliamentary text for 26,000+ motions accounts for most of that.

## What the Axes Actually Mean

One of the trickiest problems was labeling the SVD axes. The first component reliably captures left-right economics. But components 3 through 10? The mathematical procedure is sound — SVD finds the directions of maximum variance — but the meaning of each axis has to be derived from the actual motions that load heavily on it.

I solved this by extracting the top 50 motions per component (by absolute loading score), then analyzing their content. Some clear patterns emerged:

- Component 1: Fiscal-economic policy vs. social welfare and international rights — the classic left-right split.
- Component 2: Nationalist vs. multilateralist orientation — PVV/FvD on one side, Volt/GroenLinks-PvdA on the other.
- Component 3: Welfare state vs. defense spending — flip of the usual axis (with SP/PvdD on the pro-welfare side, VVD/SGP on the pro-defense side).

How much do the first two axes actually capture? In a single-window SVD (current parliament), PC1 explains ~29% of the variance and PC2 explains ~11.5% — together accounting for ~41% of all voting variation. PC3 adds another 8.6%, but from there it drops off sharply: PC4 is under 9%, and components 5–8 each contribute 3–6%. The classic "scree plot" elbow is clear: the first two dimensions carry the signal, the rest is real but diminishing. When looking across all time windows with Procrustes alignment, the picture flattens considerably — PC1 and PC2 each explain ~14.6% and ~13.1% respectively — because aligning 41 different windows distributes variance more evenly. The multi-window perspective is more conservative, but the message is the same: Dutch politics is largely two-dimensional. Scree plot across 41 aligned quarterly windows. PC1 = 14.6%, PC2 = 13.1%.

## What's Next

Motion explorer: Given a motion, retrieve the 10 most politically similar ones from across the decade. Trace how a policy debate evolved — who championed it, how the coalitions shifted.

Party trajectory animation: Procrustes-aligned positions, animated year by year. Watch GroenLinks-PvdA's pre-merger convergence, watch PVV consolidate its flank, watch new parties arrive and find their geometric home.

Cross-party coalition patterns: Which topics produce unusual coalition configurations — motions where the normal left-right split breaks down and unexpected alliances form.

Cabinet crisis detection: Track coalition cohesion over time. When do coalition parties start voting against each other? The Procrustes disparity between consecutive windows is itself a signal of structural political shifts.

## Reproducibility

    # Download historical data
    python scripts/download_past_year.py --start-date 2016-01-01 --end-date 2026-01-01

    # Run full pipeline (SVD, similarity cache)
    python -m pipeline.run_pipeline --db-path data/motions.db \
        --start-date 2016-01-01 --end-date 2026-01-01 \
        --window-size quarterly --text-batch-size 200

    # Enrich with full motion body text
    python scripts/sync_motion_content.py --db-path data/motions.db

All computation — SVD, similarity — runs locally on a single machine. No cloud services, no GPU required.

Democracy is more legible than it looks.