Balanced Classification Lab

Compare logistic classification models on the same untouched test set. Explore imbalanced outcomes using random oversampling, undersampling, or SMOTE.

1. Configure your classification

Open a CSV in the workspace above.

Use Prepare to manually create numerical dummy variables for categorical predictors. Missing or nonnumeric selected values are excluded. Identifiers should not be used as predictors.

2. Balance the training data

Leakage protection: stratified splitting happens first; resampling is applied only to the training portion. The test portion is never resampled. All methods use the same seeded split for fair comparison.

How to interpret

Accuracy can be misleading when classes are rare. Compare sensitivity, specificity, precision, F1, balanced accuracy, ROC AUC, and average precision (PR summary). Select the approach that fits the real cost of false positives versus false negatives. Resampling can improve sensitivity while reducing precision.

This lab fits numerical-predictor logistic models with standardized predictors and small L2 regularization, using browser-local computation. It is a teaching and exploration tool, not a substitute for externally validated clinical or high-stakes models. SMOTE interpolates within the minority class; it is not appropriate for raw categorical codes. The original dataset is never modified.