Skip to content

RETprojects/Brit-Value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brit-Value

A multi-criteria visual analytics platform that ranks all English Lower Layer Super Output Areas (LSOAs) by a composite Opportunity Score. Uses a hybrid AHP + SA-TOPSIS engine with five criteria pillars: Housing Cost, Deprivation, Healthcare Access, Transport, and Green Space.

SA-TOPSIS extends standard TOPSIS with four innovations:

  • Criterion-adaptive normalisation (vector vs percentile-rank based on skewness)
  • Criterion-adaptive ideal/anti-ideal bounds
  • Mahalanobis distance with regional covariance matrices (9 English regions)
  • Spatial smoothing via Queen contiguity weighting (alpha = 0.75)

Stack

  • Backend: Python 3.10+, FastAPI, NumPy, Pandas, SciPy, GeoPandas, libpysal
  • Frontend: Vanilla JS, Leaflet 1.9, D3 v7

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn api:app --port 8000

Open http://localhost:8000 in your browser.

On first startup, SA-TOPSIS artifacts are precomputed from data/master_table.csv (~30 seconds). Subsequent starts load from data/artifacts/ in ~2 seconds.

External Data Files

Three large files are not committed to this repo and must be downloaded manually.

LSOA Boundaries GeoJSON — required for the map and spatial weights. Download from: https://geoportal.statistics.gov.uk/search?q=Lower_layer_Super_Output_Areas_December_2021_Boundaries_EW_BSC_V4 Place the file at: data/Lower_layer_Super_Output_Areas_December_2021_Boundaries_EW_BSC_V4_6894679968818356315.geojson

NSPL Postcode Lookup (~911MB) — only needed if rebuilding master_table.csv from scratch. Download from: https://geoportal.statistics.gov.uk/datasets/5dd216d9899044348a5b08fee09ac5a4/about Place the file at: data/mapping/NSPL_FEB_2025_UK.csv

HM Land Registry Price Paid Data (~5GB) — only needed if rebuilding annual_medians.csv from scratch. Download from: https://www.gov.uk/government/statistical-data-sets/price-paid-data-downloads#bulk-data-downloads Look for single file section on the download url for the complete price paid transaction data. Place the file at: data/pp-complete.csv

Rebuilding from scratch

python process_iod.py
python process_jts.py
python process_greenspace.py
python process_schools_spatial.py
python price_forecast.py
python build_master_table.py

Tests

pytest tests/ -v

Validation

python -m validation.run_all

Outputs written to validation/outputs/.

Project Structure

api.py                  FastAPI app
sa_topsis.py            SA-TOPSIS engine
topsis_engine.py        Vanilla TOPSIS (validation baseline)
ahp.py                  AHP weight derivation
config.py               Criteria metadata and constants
price_forecast.py       Holt's model for price trend
build_master_table.py   Assembles data/master_table.csv
static/                 Frontend (index.html, app.js, style.css)
tests/                  Unit tests
validation/             Ablation, sensitivity, Moran's I
data/
  master_table.csv      Primary server input (33,755 LSOAs)
  price_forecast.csv    Price trend predictions
  artifacts/            Precomputed SA-TOPSIS artifacts

About

Brit-Value: A Multi-Criteria Visual Analytics Platform for UK Housing and Opportunity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors