Skip to content
ML to LLMs
Learning path

Module 24

Applied ML in practice

The day-to-day craft of tabular ML: engineer features without leakage, handle rare positives, tune efficiently, forecast time series, and detect anomalies.

  1. 1. Feature engineeringTurn raw columns into model-ready features (scaling, log transforms, one-hot and target encoding, imputation with indicators, filter selection) without leaking the label.45 min
  2. 2. Imbalanced dataEvaluate a classifier on rare positives with precision, recall, F1, MCC, and AUPRC, build SMOTE and class weights from scratch, and see that resampling mostly moves the threshold.45 min
  3. 3. Hyperparameter tuningSearch hyperparameters efficiently with random search, successive halving, and Bayesian optimization, on log scales, and report an honest score with nested cross-validation.45 min
  4. 4. Time seriesForecast a series with lag features and walk-forward validation, beat naive and seasonal-naive baselines, and avoid the lookahead leaks that make time-series models look better than they are.45 min
  5. 5. Anomaly detectionFind rare, unusual points without labels using robust z-scores, IQR fences, k-NN distance, LOF, and isolation forests, then set thresholds from an alert budget and evaluate with the few labels you have.40 min

Most real ML work happens around the model: shaping features, choosing metrics that fit a skewed problem, spending a tuning budget wisely, and validating in a way that matches how the model will be used. This module covers those skills, each with from-scratch code you can run.

ProblemCore skillClassic failure
Raw columnsscale, encode, impute, selecttarget encoding or scaling fit on test data
Rare positivesAUPRC, thresholds, class weightstrusting accuracy at 99.9% negatives
Many knobsrandom search, halving, Bayesian optimizationreporting the best search score as performance
Ordered datalags, walk-forward validation, baselinesshuffled K-fold, centered rolling windows
No labelsrobust stats, isolation forest, alert budgetsz-scores masked by the outlier itself
#LessonYou will be able to
1Feature engineeringscale, log-transform, one-hot and target-encode, impute with indicators, filter features, and avoid target-encoding leakage
2Imbalanced dataevaluate rare-positive classifiers with precision, recall, MCC, and AUPRC, and use class weights, SMOTE, and threshold tuning
3Hyperparameter tuningrun random search, successive halving, and Bayesian optimization on log scales, and report nested-CV scores
4Time seriesbuild lag features, validate walk-forward, and beat naive and seasonal-naive baselines
5Anomaly detectionscore anomalies with robust z-scores, k-NN, LOF, and isolation forests, and set thresholds from an alert budget
Next moduleModule 25: Computer vision and multimodal