Spending Behaviour Analysis & Financial Scoring

Open Banking machine learning pipeline pairing Basiq API 3.0 (CDR) financial data with scikit-learn models for transaction categorisation, anomaly detection, cash-flow forecasting, behavioural segmentation, and calibrated wellbeing scoring.

ROLE:Lead AI & Fintech Engineer·TIMELINE:2025–2026
STACK:Python 3.13 · Basiq API 3.0 (CDR) · Scikit-Learn · FastAPI · Isolation Forest · Gradient Boosting · Holt-Winters ETS

The Problem & The Chaos

Traditional personal finance management (PFM) apps fail because raw bank transaction feeds are notoriously truncated, cryptic, and noisy (e.g. 'SQ *CAFE SURRY HILLS AUS'). Consumers receive backwards-looking pie charts instead of actionable forward-looking insights or explainable financial health scoring. Furthermore, under Australia's Consumer Data Right (CDR), handling Open Banking financial data demands strict, auditable consent management without compromising user trust or privacy.

“Raw bank feed strings look like corrupted serial numbers. Character n-grams survive the truncation bank feeds inflict on descriptions. Calibrated probabilities let low-confidence predictions fall back to deterministic rules.”

We paired financial data from Open Banking/Consumer Data Rights platform basiq.io (of Cuscal Limited) with machine learning algorithms for financial data analysis and analytical insight extraction. Bank feeds arrive with aggressive string truncations, missing merchant taxonomies, and high noise. Naive LLM prompting introduces prohibitive latency, recurring API costs, non-deterministic hallucinations, and serious privacy/compliance risks when handling CDR bank data. In contrast, confirmed fraud labels are scarce and late, making unsupervised anomaly detection essential.

The Vision & System Architecture

Built on Basiq API 3.0, the consent-first architecture extracts bank accounts and transactions under an auditable CDR consent ledger. The backend streams raw transactions through a five-stage machine learning engine: TF-IDF + Logistic Regression with character n-grams for categorization, dual-layer Isolation Forest and MAD z-scores for anomaly detection, Holt-Winters ETS for household cash-flow forecasting, silhouette-tuned K-Means for behavioral segmentation, and isotonic-calibrated Gradient Boosting for explainable financial wellbeing scoring with transparent contributing factors.

System Architecture Pipeline
Click any node to inspect data flow & latency
DETERMINISTIC DATA PATH
Basiq CDR Consent & Sync — Consent-Gated Extraction
Stack: Basiq API 3.0 / FastAPILatency: Async Polling

Local mirror of Basiq CDR consent with scopes, purpose, and expiry. Token management (SERVER & CLIENT_ACCESS) and cursor pagination with retry backoff.

What I Killed

Building great software is mostly about deciding what *not* to build. Here is what we originally thought would work, why it collapsed in real usability testing, and what we replaced it with.

Design Taste & Trade-Offs

What I Killed: AI Slop vs. Shipped Craft

ITERATION 1 (KILLED)Over-Engineered
Iteration 1: Black-Box LLM Prompts & Naive Word Tokenization

Early explorations tested cloud LLM completions for categorization and advice, alongside simple whitespace word tokenizers.

Failure Symptoms:
  • ✕API latency exceeded 3.2s per sync with recurring per-token cloud costs across high-volume transaction feeds
  • ✕Word-level tokenizers failed completely on truncated bank descriptions (e.g., 'WOOLW 3192' vs 'WOOLWORTHS')
  • ✕LLM hallucinations produced inconsistent financial advice and uncalibrated health ratings
  • ✕Privacy & CDR compliance complications sending raw financial account streams to third-party endpoints
Usability Audit: 14% categorization failure rate on real Australian bank strings and complete lack of explainable audit trails for credit scoring.
SHIPPED IN PRODUCTIONStripped to Essentials
Shipped Version: Deterministic Scikit-Learn Pipeline + Transparent Five Pillars

We threw away cloud LLM prompts and deployed a lightweight, 100% offline-capable scikit-learn stack. Character n-grams, Isolation Forests, Holt-Winters ETS, and isotonically calibrated Gradient Boosting with full feature attribution.

Craft Improvements:
  • ✓Sub-20ms total pipeline inference latency with zero API per-token operational costs
  • ✓Character n-grams achieve >96% categorization accuracy even on severely clipped merchant strings
  • ✓Transparent five-pillar scoring (savings rate, emergency buffer, debt servicing, credit utilisation, spending stability)
  • ✓Runs completely offline against bundled mock Basiq server or live Basiq API 3.0 via a single configuration toggle
Craft Principle: “In financial engineering, interpretability, determinism, and mathematical calibration trump black-box novelty every single time.”

Interactive Product Prototype

Try the real component states below. Everything runs client-side in React with real state machines.

Interactive Product Artifact

FinScore Analytics & ML Engine

Interactive ML Analysis Engine

Open Banking Financial Behaviour & Health Scoring

Clean, explainable machine learning running directly on bank transaction feeds (Basiq CDR API 3.0). Switch profiles or trigger an anomaly below to see how the models respond.

Financial Health
84/ 100

Strong & Resilient

K-Means Segment
Stable Accumulator

Silhouette k=4 Cluster

30-Day Cash Trajectory
+$840 / month

Est. Close: $5,120

Anomalies Flagged
0 Outliers (Normal)

Isolation Forest + MAD

Holt-Winters ETS 30-Day Liquidity Forecast

Evaluates short, noisy household transactions with additive trend and weekly pay-cycle seasonality.

Model: Holt-Winters ETS (Add + Damped)
TODAYHOLT-WINTERS FORECAST →$3400$5900$5350$3230$6150
Historical Bank Ledger
Holt-Winters ETS Prediction
95% Confidence Band
Auto-detects fortnightly payroll & fixed monthly rent dips
Why this matters

Most budgeting apps show past spending. This graph projects whether the user will have enough cash to cover their next mortgage/rent before their next salary arrives.

How the ML works

Holt-Winters decomposes noisy data into baseline level, trend, and weekly cycles. If data history is too brief, it safely falls back to damped linear drift.

Projected Safe Buffer

Projected minimum account balance is $3,120, giving the user a 98% probability of zero overdraft.

AUSTRALIAN OPEN BANKING (CDR) // BASIQ API 3.0 // CUSCAL LTDMODELS: SCIKIT-LEARN + FASTAPI // ZERO CLOUD TOKEN LATENCY
CLIENT-SIDE REACT // SUB-16MS REACTION LATENCYTEST REAL INTERACTIONS

Takeaways & What I Learned

  • 01.Character n-grams survive bank feed truncation: bank feeds routinely chop merchant strings mid-word, rendering dictionary tokenizers useless.
  • 02.Anomaly detection in personal finance requires dual granularity: Isolation Forest finds globally odd transactions, while MAD z-scores catch what is odd for that specific user's historical cadence.
  • 03.Interpretable segmentation matters: when user clusters drive financial recommendations, advisors and auditors must be able to inspect centroid coordinates directly.
  • 04.Financial wellbeing scores require feature attribution: returning exact contributing factor deltas empowers users to know precisely how to improve their score.