SCARLET: Fraud-Pressure Radar Built on Public Complaint Data

⬅️ Back to Tools

SCARLET

What it isweekly fraud-pressure regime classifier with a spike-forecasting hurdle model
PlatformPython 3, macOS / Linux / Windows
Pricefree, source on GitHub, no license file
Linkp-hereford/scarlet

I wanted to know whether public complaint data can warn a bank before a fraud wave lands in its own numbers. SCARLET, a seven-star solo repo by P.H., answers exactly that question with CFPB complaints and GDELT news. I cloned it, read all eleven modules, ran the decision engine on test rows, and pulled live CFPB data through its ingestion code. The idea is better than the packaging.

  1. It operates one level above normal fraud models. Instead of scoring transactions, it answers whether fraud pressure is rising above recent norms and whether controls should tighten now. The decision engine maps each week to normal, elevated, or stressed from level, growth, and z-score, then assigns a posture from monitor up to tighten_controls. I verified the mapping runs: a calm week returns monitor, a week at 200 complaints against a 120 baseline with a z-score of 2 returns tighten_controls. Concrete thresholds, no mysticism.

  2. The leading-signal design is the clever part. Industry-wide complaints enter only in lagged form, so market-wide fraud campaigns surface as upstream warnings without leaking the future into the current week. A GDELT news count compresses the filing lag further, since coverage pushes latent victims to complain. The forecaster is a hurdle model: a logistic classifier for whether the week crosses the 100-complaint stress line, plus a ridge regressor trained on stress weeks only for the magnitude. The author reports walk-forward stress-week error of 55 against a lag-1 baseline of 143, with recall of 1.0. Small sample, self-reported, but the evaluation method is the honest one for time series.

  3. The README shows its miss, which is why I trust the rest. On the December 2024 event the model predicted 116 against an actual 450, driven by an external incident no complaint series could see. The author calls it an information ceiling rather than a modelling failure, and the economic layer is labeled scenario framing throughout: $250 per complaint, 0 to 25% reduction by action intensity, explicitly not realized P&L. A risk repo that discloses its worst week is rarer than a risk repo with good metrics.

  4. The honest limitations are all verified, because I hit them. The industry loader expects the CFPB bulk-download column names, so feeding it the API output from step 1 crashes features with a KeyError on Date received. The README’s step 4 names a file that does not exist: it says run_pipeline.py, the file is run_pipline.py. The code has six control actions while the README describes four. There is no LICENSE file and no data committed, so the first run is a very long paginated CFPB pull. GDELT returned an empty body when I tested it, though the code handles that by design, recording zero rather than dying.

  5. The incumbent comparison writes itself. This does what an internal bank fraud dashboard does at the posture level, with zero internal data. That is also its ceiling: weekly aggregates cannot score transactions or customers, and the author says so outright. Treat it as a portfolio system and a clean hurdle-model example, not a deployment candidate.

Install & first run

git clone https://github.com/p-hereford/scarlet.git && cd scarlet
pip install -r requirements.txt
python src/ingestion.py

This pages through CFPB complaints for 2022 to 2024 plus GDELT weeklies, so expect a long run. You should see JPM and industry record counts, then a GDELT week count. I confirmed the CFPB endpoint live: one month of JPMorgan complaints returned 1,570 records.

python src/features.py
python src/forecasting.py
python src/run_pipline.py
python src/brief.py

Run everything from the repo root, and note the run_pipline spelling, which matches the repo, not the README. Two gotchas before features: the industry CSV must use bulk-download column headers (Date received, Issue, Consumer complaint narrative), or the load fails. Success looks like ASCII performance grids in the terminal and a brief starting SCARLET Risk Brief, followed by a recommended action in plain capitals.

Worth your time if: you build risk-analytics demos or want a small, well-commented hurdle model on real public data. Skip it if you need transaction scoring, a maintained library, or code you can legally reuse, since no license is declared.

Related TMFNK Content

Crepi il lupo! 🐺