Work / Machine learning

Ensembles on ten principal components

PCA + ensembles, 30→10 features, grid-searched cross-validation.

§ 1 · Problem

Comparing classifiers under collinearity

The Wisconsin Diagnostic Breast Cancer dataset carries 30 correlated numeric features drawn from digitized fine-needle-aspirate images. The features overlap heavily, and the sample is not large. The task was to compare classification approaches honestly under those two constraints — dense multicollinearity and limited data — rather than to chase a single headline score.

§ 2 · Data

Wisconsin Diagnostic Breast Cancer

The data is the Wisconsin Diagnostic Breast Cancer set (WDBC) from the UCI Machine Learning Repository in Irvine, CA, accessed through its Kaggle mirror. Each record is 30 numeric measurements computed from a digitized FNA image. A correlation heatmap makes the problem visible: the features are densely collinear, which is exactly what motivates the dimension reduction that follows.

§ 3 · Method

PCA, then four model families

Principal component analysis reduced the 30 features to 10 components while preserving 95% of the total variance — two-thirds of the dimensions dropped, almost none of the signal. On those components, four model families were trained through a shared evaluation pipeline: Random Forest, a linear SVM, Logistic Regression, and KNN. Each was tuned with grid search over 7-fold cross-validation, so every model was compared on the same footing.

§ 4 · Results

A clean, defensible comparison

PCA removed two-thirds of the feature dimensions while retaining nearly all of the variance, which is what let the downstream comparison stay legible. All four model families were then evaluated with confusion matrices and ROC/AUC curves rather than a single accuracy figure, and the shared pipeline is what kept the comparison clean and defensible.

0% 50% 100% 95% cumulative 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 PRINCIPAL COMPONENT
Fig. 1 — PCA variance analysis: 30 features reduced to 10 components (95.2% variance retained)
§ 5 · Discussion

What the pipeline bought

The value here was in the setup, not a winner. Reducing to 10 orthogonal components tamed the collinearity that a correlation heatmap had exposed, and routing four classifiers through one grid-searched, cross-validated pipeline meant the side-by-side ROC curves reflected the models rather than incidental differences in how each was fit. That is the defensible part: the comparison can be trusted because every family met the same evaluation.