docs: end-to-end notebook on the KDD Cup 1998 donor file - #228
Merged
Merged
Conversation
Notebooks 01 to 03 all run on synthetic data. Notebook 04 runs the whole library path on the 95,412 real donors of KDD Cup 1998: reshape the wide export into a gift log, clean it and add fiscal years, read it back as a Raiser's Edge export with a pledge row, build as-of RFM features, backtest a lapse model with as-of against whole-history features, fit a response model with a leakage-safe wealth imputer and permutation importance, predict gift size with a calibrated interval and an ask ladder, make the mailing decision against the $0.68 piece cost, check selection rates by gender, and save the fitted bundle. A tutorial page summarises it with a Colab badge and the results of one run. CI caches ~/philanthropy_data so the notebook step does not depend on the UCI mirror on every push.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
examples/notebooks/04_kdd98_end_to_end.ipynband a tutorial page, "End to End on Real Donor Data", linked from the Tutorials nav and index.Notebooks 01 to 03 all run on synthetic data. This one runs the whole library path on the 95,412 real donors of KDD Cup 1998, in ten steps: size up the file (Gini, top-donor share), reshape the wide export into a gift log with
CRMCleanerandFiscalYearTransformer(plus retention, lifetime value and the waterfall), read it back as a Raiser's Edge export with a pledge row, build as-of RFM features, backtestLapsePredictorwith as-of versus whole-history features underFiscalYearGroupedSplitter, fit a response model (WealthScreeningImputer+MajorGiftClassifier) with permutation importance, predict gift size withAskAmountRecommenderwrapped inGiftIntervalCalibratorplus an ask ladder, decide who to mail against the $0.68 piece cost, check selection rates by gender, and save the bundle.Results from one run,
random_state=0, are on the tutorial page. One of them is worth reading before review: on the held-out final mailing, the whole-history lapse model scores slightly higher (0.583 against 0.547), but its backtest overpromised by more (0.218 against 0.170). The notebook text makes the backtest-reliability point, not a claim that the leaky model does worse in production.CI: the notebook downloads the ~35 MB archive from UCI on first run, so the notebook step in
ci.ymlnow caches~/philanthropy_data, keyed on the loader file that pins the checksum. Committed without outputs, matching 01 to 03.Verified locally:
pytest --nbmakeon the notebook passes (about 40 s with the archive cached),mkdocs build --strictpasses, and the pre-push full suite passed.Note for the Colab badge: the Raiser's Edge step needs
mainuntil the next release; the first cell shows the install line.