Skip to content

Handouts

Full class walkthroughs as single-page documents. Each one renders every figure from real runs, ships the code to reproduce it, and includes solved checkpoints.

They complement the class pages rather than replace them: each goes deep on one topic and works both as a companion during class and as a reference afterwards.

Written in Portuguese

The handouts are course material for the in-person classes and are written in Brazilian Portuguese. The code, the library names and the figures are language-independent.

  • Metrics and evaluation: choosing the number that decides


    Fraud detection — 20 000 transactions, 2.5% of them fraudulent, where the model that does nothing scores 97.5%.

    One problem followed from raw data to decision, with a model that is not retrained after the second block: what changes from beginning to end is which number we look at. The base rate and the trivial baseline; three models compared by AUC-ROC and by average precision, which here rank the models differently; the effect of the base rate on each curve, measured by subsampling; the threshold derived from the cost of the two errors, against the factory 0.5 that costs twice as much; Platt scaling, which cuts ECE sixfold without moving the fourth decimal of AUC. It closes with regression on real data: baselines, RMSE/MAE and the residual plot.

    ~2 h · 7 figures · 3 models · 6 checkpoints with solutions

    open · the script that produced it

Classroom use

Each handout has an anchored sidebar index, a copy button on every code block, and its own print stylesheet — the menu, buttons and interactive elements are dropped when printing or exporting to PDF.

The simulators for this chapter live on the class pages: threshold, confusion matrix, cost and calibration in classification, and mean vs median, outlier and residuals in regression.