CFPB Complaints Analysis

PythonSQLDuckDBpolarsSciPystatsmodelsPower BIMatplotlibpytest

An end-to-end Python and SQL (DuckDB) analysis of all 18.56M complaints filed with the US Consumer Financial Protection Bureau since 2011. It scores 1,676 company-product pairs with an empirical Bayes scorecard, tests whether the CFPB's 2026 intake changes reduced complaints with an interrupted time series, and detects complaint spikes tied to enforcement actions, delivered as a four-page Power BI dashboard.

CFPB Complaints Analysis screenshot

Highlights

  • SQL pipeline over 18.56M complaints, harmonizing 21 product labels into 11 groups with build-time validation
  • Empirical Bayes (beta-binomial) scorecard ranking 1,676 company-product pairs with 90% intervals
  • Found that relief rates partly measure how companies label responses, not only how they treat customers
  • Interrupted time series with Newey-West errors: no detectable effect of the 2026 changes on credit-reporting complaints
  • Robust z-score spike detector flagged 17 events, including Cash App jumping from 14 to 12,793 complaints a day
  • Handled right-censored outcomes and publication lag with cutoffs computed from the data
CFPB Complaints Analysis – Data Analytics | Mayur Bijarniya