Tag
#scikit-learn
8 articles

Five Percent of My Rows Were Lying. Winsorizing Fixed Nothing, Dropping Fixed Everything
5% of training targets shifted by 25 points: at n=150, OLS test RMSE rose 70% over the clean-data floor; at n=1,000, 7%. Dropping rows by residual and Huber loss both recovered the floor. Winsorizing at the 1st/99th percentiles barely helped, and at n=300 it made things worse.
Ibrahim Denis Fofanah·Nov 27, 2026·13 min

Missing Values: I Deleted 40% of a Dataset to See Which Imputer Survives
I deleted 20% and 40% of the cells in a 569-row dataset, then ran five imputation strategies through logistic regression and a random forest. At 20% missing, the method barely matters. At 40%, iterative imputation recovered near-complete performance while KNN fell apart and dropping rows was already impossible.
Ibrahim Denis Fofanah·Nov 21, 2026·12 min

Three Rankings, One Model, Little Agreement: Feature Importance Is a Question, Not a Number
Three standard importance methods on one random forest, same data, same model: MDI and permutation agree on 4 of the top 5, MDI and drop-column on 2 of 5, and the MDI vs drop-column rank correlation is -0.36.
Ibrahim Denis Fofanah·Nov 16, 2026·15 min

98% Accurate and Useless: Six Imbalance Fixes, Measured on a 2% Positive Class
Six models on one 2% positive dataset: the baseline caught 1 of 59 positives, class weights caught 45 at 6% precision, and a balanced random forest predicted zero positives despite the best AUC. Threshold tuning was the only fix that raised F1.
Ibrahim Denis Fofanah·Nov 12, 2026·11 min

Scaling Gave SVM 8 Points and Trees Nothing. I Ran Four Models Raw and Scaled.
SVM went from 88.8% to 97.2% accuracy with one preprocessing line. Random forest moved zero. Logistic regression stopped warning and converged in 20 iterations instead of 1,000.
Ibrahim Denis Fofanah·Nov 7, 2026·10 min

Same Model, Ten Seeds, a 3.5-Point Swing: Why One Split Is Not a Result
Same data, same code, ten split seeds. Logistic regression ranged from 95.8% to 99.3%, and the "winning" model flipped on two seeds. A single split is not a result.
Ibrahim Denis Fofanah·Nov 2, 2026·8 min

Five Leaks That Inflate Your AUC: I Measured Each One
Five controlled experiments, one per leak: honest AUC vs leaky AUC on the same data-generating process. Target leakage bought +0.16, pre-split feature selection +0.26, repeat groups +0.15.
Ibrahim Denis Fofanah·Oct 19, 2026·11 min

Your 0.85 Meant 0.98: A 20,000-Row Calibration Test That Caught a Top Model Misstating Its Own Odds
On 20,000 rows, a random forest with AUC 0.972 had a calibration error of 0.082. Sigmoid calibration cut it to 0.004. Gaussian naive Bayes fell from 0.050 to 0.012 with isotonic calibration, and AUC moved by at most 0.001.
Ibrahim Denis Fofanah·Oct 14, 2026·10 min