Skip to content
Projects / A93-07

Fair Price Engine

A home-built ML valuation engine for Swedish used cars, trained on about 130,000 listings and deliberately kept from cheating.

Part no.
A93-07
Status
working
Platform
Python · Data / ML
Year
2026
Stack
PythonPlaywrightSQLiteXGBoostMLflowStreamlitDocker
~130kListings in the dataset
3Targets: price, residual value, time-to-sell
DailyRefresh via cron on Railway
90Commits
01 — The problem

Used-car market data costs a lot, and the valuation tools you can get are black boxes. You can't see why a car is "worth" what they say.

02 — The case for it

A local-first dataset of the Swedish market that I own, for pricing analysis, dealer benchmarking and EV-versus-ICE research. Models I can take apart, ablate and explain.

03 — Back of the napkin
Back of the napkinRough · not a forecast

Research tool today. As a business it would sell valuations to dealers or lenders, but only on licensed data.

  1. Dealers who might pay for valuations (assumption)200
  2. ×Price€50/mo
  3. =Monthly recurring revenue€10k
  4. −Licensed market dataunknown
  5. =Real margindepends entirely on that
Running costs
Daily scrape and refresh on Railway
≈ €15/mo
Training
on a laptop, €0
Storage
SQLite, €0
At 10× / 100×

Compute is trivial: XGBoost trains in minutes on 130k rows. What limits growth is the data rights and how fresh the data is, not the model.

Verdict

A great learning project. A real product needs a data licence before anything else.

04 — How it works
Diagram · Data to valuation
  1. 01CollectPolite scraping of public listings, by sitemap and HTTP plus Playwright.
  2. 02StoreNormalised SQLite, with a CLI for stats, queries and CSV export.
  3. 03FeaturesThe site’s own price estimate (the "answer key") is deliberately dropped.
  4. 04Model tournamentXGBoost per segment and regime, picked by a router, tracked in MLflow.
  5. 05ExplainConfidence score, comparable cars and a flag for mispriced listings in a Streamlit app.
06 — Engineering highlights
01

Leakage hunted down

Dropping the obvious "answer key" feature cost points on paper but gave a model that actually generalises.

02

A blended objective

Models are scored on MedAPE, MAE and RMSE together, so no single metric gets gamed.

03

Explained in plain English

An ML overview written for non-ML readers explains what the model does and where it shouldn’t be trusted.