GQ / lab logES / EN
← Back to the log

2025

Breast cancer diagnosis with DNNs, SVMs and PCA

Three approaches on Breast Cancer Wisconsin, with a Keras neural network, a cross-validated comparison of regularized models, and dimensionality reduction with PCA.

Breast cancer diagnosis with DNNs, SVMs and PCA

Problem

Classify tumors as benign or malignant from cell measurements.

Data

Two versions of the Wisconsin breast cancer data. The cross-validation study uses *Diagnostic* (569 tumors, 30 features, bundled with scikit-learn). The DNN and the PCA use a course-provided version of *Original* (583 samples, 9 continuous cell features, 65% benign), which is not included in the repo.

Method

A DNN with a search over layers, units, dropout and optimizer; L1/L2 logistic regression, SVMs and trees with cross-validation; PCA with a scree plot and a 90%-variance criterion.

Result

The L2-regularized SVM reached 97.6% cross-validated accuracy and 94.7% on test (F1 0.947), the DNN 94.5% on test, and 3 principal components keep 81.9% of the variance.

Stack

  • Python
  • TensorFlow
  • Keras
  • scikit-learn
  • pandas

Context

Course: Machine Learning II · Data Mining · 2025

View the code on GitHub ↗