Work / Research Centre Quality Tiers
Machine LearningClassifying 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.
Screenshot comingimages/research-centre.png01Problem
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.
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:
| K | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|
| Silhouette | 0.603 | 0.552 | 0.442 | 0.336 | 0.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.
| Tier | Centres | Facilities | Hospitals | Pharmacies | Diversity |
|---|---|---|---|---|---|
| Premium | 17 | 9.53 | 3.47 | 4.12 | 0.85 |
| Standard | 17 | 4.94 | 1.53 | 2.06 | 0.56 |
| Basic | 16 | 2.31 | 0.50 | 0.44 | 0.28 |
Every tier appears in every city, so location isn't a hidden proxy for quality.

06Serving
- FastAPI:
POST /train,POST /predictandPOST /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.
Next project
Fake News Detection →images/fake-news.svg