Toby Lowe Analysis you can check · Manchester

Work MSc coursework · 2026-03

Supervised versus unsupervised classification of vertebral column data

How much of the clinical normal/abnormal distinction in the vertebral column biomechanical dataset is recoverable from geometry alone, and how much does supervision add?

In one lineLogistic regression 80.65% against k-means at 65.5% — a single-split point estimate I would not defend as significant.

Attribution
Group project. The title page lists five student IDs and a code comment in the appendix refers to six group members; the report does not attribute sections individually, so I make no claim to specific sections.
Methods
exploratory data analysis · k-means clustering · principal component analysis · logistic regression · robust scaling · stratified cross-validation
Tools
Python · pandas · scikit-learn · seaborn · matplotlib · R

The question

The vertebral column biomechanical dataset holds six spinal and pelvic measurements per patient plus a clinical label of normal (NO) or abnormal (AB). The report for DATA70132 (Statistics and Machine Learning 2, University of Manchester), dated 23 March 2026, applies one unsupervised and one supervised classification method and compares them.

This is a standard teaching dataset and nothing here is a clinical finding. The question worth asking is methodological: how much of the normal/abnormal split sits in the geometry itself, visible to an algorithm that has never seen a label, and how much of the rest has to be bought with supervision? The comparison, not the classifier, is the point.

The data

Six continuous features — pelvic incidence, pelvic tilt, lumbar lordosis angle, sacral slope, pelvic radius, grade of spondylolisthesis — plus the class label.

The EDA surfaced three problems. First, the features live on very different scales: pelvic tilt averages 17.5 while pelvic radius averages 117.9, which the report reads as an indication that higher-variance features could dominate distance-based algorithms if no scaling is applied. Second, grade of spondylolisthesis is heavily right-skewed, with a median of 11.77 against a maximum of 418; the report takes this as suggesting most patients have small values while a subset deviates far more. Third, pelvic incidence and sacral slope correlate at r = 0.81, which the team read as suggesting redundancy between the two measures. A fourth issue appears only in the notebook rather than the written EDA: a code comment records that the classes are imbalanced, and class_weight="balanced" is tested for that reason.

Two honest gaps. The report never states the sample size: the k-means confusion matrix accounts for 117 assignments to AB and 193 to NO, summing to 310 rows, but that figure is inferred rather than stated. And the notebook runs a missing-value check whose result never appears in the write-up, so I cannot claim the data was complete.

Approach

Because of the skew and the extreme values, the team used RobustScaler (centre on the median, divide by the IQR) rather than standardisation on the mean and standard deviation. That is the one preprocessing decision the report traces directly back to an EDA finding.

For the unsupervised half, k-means. k = 2 was chosen from an elbow plot — WCSS drops from 1201.76 at k = 1 to 701.18 at k = 2 — reinforced by the fact that the dataset carries two known classes. The algorithm was restarted 10 times from different initialisations because k-means can settle in a local minimum. PCA was then used to project the six dimensions to two for visualisation.

For the supervised half, logistic regression, chosen as interpretable, probabilistic and suited to a binary outcome, with the standard 0.5 threshold. The split was 80/20 stratified; the notebook records that a 90/10 split would leave too small a test set here. Hyperparameters (C over logspace(-3, 3, 7), L1/L2 penalty, liblinear/lbfgs solver, class weighting) were tuned by 5-fold stratified cross-validation.

Linear discriminant analysis was also implemented and cross-validated in the same notebook, with a row reserved for it in the results table — but no LDA numbers appear in the written report, so that comparison was computed and then never reported.

What I found

k-means reached 65.5% accuracy once clusters were mapped to true labels, with markedly asymmetric behaviour: precision 0.94 and recall 0.52 for AB, precision 0.48 and recall 0.93 for NO. Rerunning without the extreme spondylolisthesis outlier moved accuracy only from 65.5% to 67.0%, which the report reads as suggesting the robust scaling was already effective. Centroid separation was largest on grade of spondylolisthesis (around 49.24 units) and smallest on pelvic radius (around 5.38 units). The first two principal components captured 49.4% and 23.2% of variance (72.6% together); in that space the clusters broadly align with the clinical labels but overlap visibly in the middle.

Logistic regression on the held-out test set: accuracy 80.65%, precision 0.8750, recall 0.8333, F1 0.8537, ROC-AUC 0.9048. Its largest positive coefficient was grade of spondylolisthesis, consistent with both the EDA and the cluster separation.

No confidence intervals, p-values or significance tests appear anywhere in the report. The roughly fifteen-point gap between the two methods is a single-split point estimate and I would not defend it as statistically significant.

What this doesn't show

The two headline accuracies are not like-for-like. 65.5% is k-means scored across every row it clustered; 80.65% is logistic regression on a held-out fifth. Placing them side by side overstates how cleanly supervision wins.

The cluster-to-label mapping took whichever of the two possible assignments scored higher. That uses the labels to pick the mapping, so the k-means figure is mildly optimistic and is not a purely unsupervised evaluation. A silhouette score was imported but never reported, so there is no label-free measure of cluster quality at all.

Uncertainty is absent by construction: one train/test split, fixed random seeds, no repeats, no bootstrap. Twenty per cent of roughly 310 rows is on the order of sixty test observations, so precision of 0.8750 rests on a few dozen predictions and would move substantially under resampling.

The r = 0.81 collinearity between pelvic incidence and sacral slope was identified and then left in the model. Coefficient magnitudes are unstable under collinearity, so "grade of spondylolisthesis has the largest coefficient" is suggestive rather than settled.

Next steps: repeated stratified cross-validation or bootstrapping to put intervals on every headline metric, silhouette rather than labels for cluster quality, report the LDA results the notebook already computes, and drop or combine the collinear pair before interpreting coefficients. </antml_markdown>