Back
Model evaluation · 2023

Comparing 10 Classifiers

Benchmarked ten models on the Wisconsin breast cancer dataset by precision, recall, F1 and ROC-AUC. Logistic regression reached 98% accuracy.

Context

AISC, UC Davis, Dec 2023

Tools

Python, NumPy, pandas, scikit-learn, XGBoost, Matplotlib

Code

View on GitHub

The question

Given the same data, which classification model does best at labeling a tumor as malignant or benign, and how do you judge "best" when a false negative costs far more than a false positive?

Approach

  1. Prepare the data. Standardized features from the Breast Cancer Wisconsin dataset and split it into training and test sets.
  2. Train ten models. Logistic regression, k-nearest neighbors, support vector machine, decision tree, random forest, gradient boosting, naive Bayes, a neural network (MLP), AdaBoost and XGBoost.
  3. Compare them fairly. Scored each model with confusion matrices, precision, recall, F1 and ROC-AUC, and plotted ROC and precision-recall curves.
Result98%

accuracy for logistic regression, the simplest model tested.

ROC curves for ten classifiers, AUC from 0.94 to 1.00
ROC curves. Most models scored an AUC of 0.99 to 1.00; the decision tree was lowest at 0.94.
Precision-recall curves for ten classifiers
Precision-recall curves for the same ten models.
Model comparisonPrecision & recallROC-AUCVisualization
Back to all projects