Companion files

Machine Learning for Finance

A Practitioner’s Guide to Building, Validating and Defending a Credit Model That Decides

These are the four Excel workbooks that go with the book. Every figure the book prints is reproduced in them by a live formula rather than a typed constant — move a bin boundary, change the loss given default, drag the cut-off, and every dependent number moves. Each one ends with a Checks sheet setting the printed figure beside the computed one: 140 controls in all, every one green. If a control ever reads FAIL, the workbook is wrong, not the book.

Free to download. No sign-up, no email address, nothing to fill in.

All four workbooks

Download the ZIP760 KB

Everything described below is inside it, with the read-me.

The four workbooks

Conventions used throughout

Blue texta hardcoded input — you may edit these
Yellow fillan input cell; everything else on the sheet is a formula
Black texta formula — do not overtype these
Checks sheetthe printed figure beside the computed one, with a PASS or a FAIL

Why the checks matter more than the models

A workbook that agrees with a book proves nothing on its own — the author wrote both. What the Checks sheets do is different: they force the model to reproduce, from a formula, a number that was printed before the model existed.

Two quantities are carried as data rather than recomputed, and both are flagged as inputs on the page itself. The eight fitted regression coefficients, because a logistic regression cannot be fitted in a spreadsheet. And the boosted-tree score on every row, because an ensemble of a hundred and eighty trees cannot be rebuilt in one either. Everything downstream of them — their area under the curve, their bands, their profit at every approval rate — is computed by the same live formulas as the card's, so the comparison is like for like.

Where two correct computations disagree, both are printed. The rank-sliced deciles put exactly 600 cases in every band; the fixed-boundary bands, which calibration and the stability index require, put 600, 599, 601, 600, 600, 598, 602, 600, 600 and 600, because scores repeat and ties have to fall on one side. Two non-bad cases move. Neither table is wrong and the gap is not smoothed away.

Opening the files

The workbooks open in Microsoft Excel, LibreOffice Calc, Google Sheets and Numbers. They use no macros and no add-ins, so nothing needs to be enabled or trusted. If your spreadsheet asks to update links on opening, decline — there are none.

Articles on this book

Also by Julian R. Sterling

The other books with companion files. The full list of titles is on the author page.