Module resources
Evaluation, statistics and data
Checked sources to go further than the lessons. Back to the module.
Recommended learning sequence
Work through these in order.
Metrics and scoring: quantifying the quality of predictions (opens in a new tab)
Start with the scikit-learn guide to metrics. It defines precision, recall, F-beta, balanced accuracy, average precision and the Brier score exactly as lesson 1 uses them, and shows which loss goes with the median and which with the mean.
Tuning the decision threshold for class prediction (opens in a new tab)
Then the guide to tuning the decision threshold. It explains why the default of 0.5 is rarely right and warns against tuning a threshold on the data that trained the classifier, which is the cost-based cut of lesson 1.
scipy.stats.bootstrap (opens in a new tab)
For lesson 2, the reference for the bootstrap interval, with the percentile, basic and BCa methods and the warning about degenerate resamples. Read it beside the coverage table in the lesson.
scipy.stats.false_discovery_control (opens in a new tab)
Next, Benjamini-Hochberg and Benjamini-Yekutieli in SciPy, with the conditions under which the false discovery rate is controlled. Check them against the many-comparisons section.
For lesson 3, the imputation guide: simple and model-based imputers and the missing-indicator option. Note that it does not cover the MCAR, MAR and MNAR vocabulary.
scipy.stats.ks_2samp (opens in a new tab)
Close with the two-sample Kolmogorov-Smirnov test, to compare its statistic and its continuity assumption with the PSI calculation in the drift section.
All resources
Official documentation
TimeSeriesSplit (opens in a new tab)
The forward-chaining splitter with its test size and gap options, including the 12-sample examples the lesson reproduces.
DummyClassifier (opens in a new tab)
The baseline classifier and its strategies. Run it first on your own rare-class data so that every metric you report has something to beat.
Datasets: Imbalanced datasets (Machine Learning Crash Course) (opens in a new tab)
A short course page on rare classes, downsampling with upweighting, and the prediction bias that results. It matches the roughly 80 to 20 arithmetic in lesson 1.
Over-sampling (imbalanced-learn user guide) (opens in a new tab)
How random oversampling and SMOTE work, and the cautions about inliers, outliers and categorical features. Read it before you reach for resampling.
Introduction to correctR (corrected resampled t-test of Nadeau and Bengio) (opens in a new tab)
The corrected resampled t statistic of Nadeau and Bengio, with the reason the plain test is too liberal and the approximation used for k-fold.
Further reading
The American Statistical Association's six principles on p-values, in the press-release version. A compact answer to the standard misreadings.
Research papers
SMOTE: Synthetic Minority Over-sampling Technique (opens in a new tab)
The original SMOTE paper. Read the abstract for the definition of imbalance and the reported result that combining synthetic oversampling with undersampling beat undersampling alone.
Cross-validation failure: small sample sizes lead to large error bars (opens in a new tab)
A short paper on how wide cross-validation error bars are at small sample sizes, and why the spread across folds understates them. Abstract page only.
Inference and Missing Data (opens in a new tab)
The source of the idea of data missing at random and of when the missingness process can be ignored. Abstract page only.
Feature Hashing for Large Scale Multitask Learning (opens in a new tab)
The feature hashing paper, with its argument that interference between random subspaces is negligible with high probability. Abstract only; the collision counts in lesson 3 show the practical cost.
CatBoost: unbiased boosting with categorical features (opens in a new tab)
Describes a special kind of target leakage and an algorithm for categorical features designed to counter it. Read the abstract after the leave-one-out discussion in lesson 3.