Machine learning
How well does a model predict on new data, and why? Out-of-fold evaluation, learning curves and model-agnostic explanations — each with its uncertainty.
Confusion matrix with metrics
How well a classifier sorts tweets into Environmental, Social and Governance topics — out-of-fold 3 × 3 confusion matrix with bootstrap intervals for the metrics.
yardstick::conf_mat() + autoplot()Precision–recall curves
Out-of-fold precision–recall curves for two classifiers predicting which Facebook users share COVID-19 fake news, with average precision and the no-skill baseline.
yardstick::pr_curve() + autoplot()Learning curve
Training and cross-validated accuracy as the training set grows, for two models predicting which Facebook users share COVID-19 fake news.
caret::learning_curve_dat() + ggplot()Cross-validated model comparison
Fold-by-fold R² of six models predicting the waste rate of production batches, with means and corrected 95% intervals.
caret::resamples() + bwplot() / tune::autoplot()Permutation importance
Which process features a random forest relies on to predict a batch's waste rate — drop in test-set R² when each one is shuffled.
vip::vip(method = "permute")Partial dependence with ICE curves
How a batch's predicted waste rate changes with machine speed and with days since maintenance — the average (PDP) over one curve per batch (ICE).
pdp::partial(ice = TRUE) + autoplot() / iml::FeatureEffectAdvanced: SHAP explanations
Shapley values split every prediction into additive feature contributions — globally, feature by feature, and for a single case.
SHAP summary (beeswarm)
Every production batch's SHAP value for every process feature, coloured by the feature's value, with mean |SHAP| importance.
shapviz::sv_importance(kind = "beeswarm")SHAP dependence plot
How days since maintenance feed into each batch's predicted waste rate, coloured by its strongest interaction partner, with a smooth trend.
shapviz::sv_dependence()SHAP waterfall for one prediction
How each process feature moves one high-waste batch's predicted waste rate from the average to the model's output.
shapviz::sv_waterfall()