Work / Research Centre Quality Tiers

Machine Learning

Classifying Research Centres into Quality Tiers

An end-to-end unsupervised learning pipeline. It groups UK research centres into Premium, Standard and Basic tiers with K-Means, then serves the result through a REST API with MLflow tracking.

Type Technical assignmentData 50 UK research centres · 5 featuresModel K-Means (K = 3)Stack scikit-learn · FastAPI · MLflow · DockerYear 2026
Scatter plot of research centres on the first two principal components, coloured by Premium, Standard and Basic tier with centroids markedScreenshot comingimages/research-centre.png

01Problem

Scoring research centres by hand is slow and inconsistent. The goal was to group them into three quality tiers automatically, based on their own facilities and what surrounds them. The model had to be served so other systems could request a tier for any new centre.

50Research centres, 5 cities
89%Variance on one component
0.55Silhouette score, K = 3
17 · 17 · 16Premium · Standard · Basic

02Data and EDA

Each centre is described by five features: internal facilities (labs, workstations, testing units), hospitals within 10 km, pharmacies within 10 km, facility diversity (0–1) and facility density. The data was clean, with no missing values and all ranges valid.

Every feature correlated strongly with every other, from r = 0.80 to 0.90. Internal facilities was the hub, at r ≈ 0.90 with both diversity and density. Better-equipped centres tend to sit in better-served areas.

03Feature analysis

  • Variance check: all five features pass a variance threshold comfortably. Scaling is essential, though. Diversity and density look negligible in raw variance purely because of their 0–1 scale.
  • PCA: PC1 explains 89.07% of variance, with near-equal loadings of about 0.44–0.46 on every feature. There is essentially one underlying dimension, which is overall centre quality. That makes a tiered split a natural fit.
  • All five standardised features were kept. With so few features and such a clear structure, dropping any would lose signal without simplifying much.

04Clustering

I used StandardScaler followed by K-Means (k-means++, 50 initialisations, seed 42). The choice of K came from the elbow method, silhouette scores and the business need for three tiers:

K23456
Silhouette0.6030.5520.4420.3360.334

K = 2 scored slightly higher but couldn't give three tiers. K = 3 keeps a reasonable separation (0.55) and matches the elbow. The final model converged in 3 iterations with an inertia of 33.40.

05Tiers

K-Means labels are arbitrary, so I mapped clusters to tiers by ranking their centroids on internal facilities. This rule is reproducible every time the model retrains.

TierCentresFacilitiesHospitalsPharmaciesDiversity
Premium179.533.474.120.85
Standard174.941.532.060.56
Basic162.310.500.440.28

Every tier appears in every city, so location isn't a hidden proxy for quality.

06Serving

  • FastAPI: POST /train, POST /predict and POST /predict/batch (up to 1,000 centres), plus readiness and liveness health checks.
  • Pipeline modules: loading, validation (minimum rows, duplicates), preprocessing, training and evaluation are separate and testable.
  • MLflow: parameters, silhouette scores and artefacts are logged per run, and the model is versioned in the registry.
  • Docker Compose: runs the API and MLflow as two containers, with a multi-stage build.

07Reflection

Fifty centres is a small sample, so the tiers describe this dataset well but should be re-checked as more data arrives. The 0.55 silhouette also shows the middle tier is the least distinct, at 0.47 compared with about 0.59 for the other two. The next steps are drift monitoring on new centres, and checking whether a tier changes when a centre's surroundings do.

← Back to all work