On an 85,429-row held-out test set, the UPI model reached 92.06% precision and 12.81% recall at a 0.5% alert budget.
85,429 held-out transactionsVerified 2026-08-28Case 09 / Operational fraud scoring
UPI Fraud Engine
UPI Fraud Engine evaluates a frozen model at the alert volume an operations team can actually review, then keeps held-out testing and seven-day replay as separate evidence.
- Role
- Machine-learning engineer
- Built at
- Personal project
- Contribution
- Features, model, thresholding, serving, and replay
- Status
- Shipped

Measured, with the denominator attached
Proof before polish.Across a 22,071-transaction seven-day replay, the UPI system recorded 75.22% precision, 12.13% recall, and no alert-budget violations.
22,071 transactions across 7 daysVerified 2026-08-2801 / What it is
The threshold is an operational decision, not a decoration on the model.
The UPI Fraud Engine scores transactions and turns the highest-risk fraction into alerts.
The operating point is constrained by an alert budget, so precision and recall are reported at the threshold the team could actually review.
A fraud operations or risk team that needs a reviewable alert queue, paired precision and recall, and a clear separation between offline evaluation and time-based replay.
I built the temporal feature pipeline, leakage controls, model evaluation, frozen serving artifacts, alert-budget thresholding, real-time API, dashboard visualisations, and seven-day operational replay.
Contribution record
02 / Product proof
See the actual product before reading the argument.
Real replay visualisation

- Input
- Transaction and historical behaviour
- Split
- Temporal holdout
- Guard
- No future leakage
Behavioural and temporal features are computed without letting future information leak into an earlier transaction.

The frozen model's score distribution is cut at the 0.5 percent review budget, then precision and recall are reported together.

A separate seven-day replay applies the chosen operating policy and records daily precision, recall, and budget compliance.
03 / Problem and responsibility
A strong model metric can still create an alert queue no team can review.
Fraud datasets are imbalanced, and a strong ROC-AUC can still produce an unusable queue.
The model, temporal features, threshold, and replay all need separate evidence so an offline score is not mistaken for operational performance.
- Data
- Temporal splitting, leakage prevention, behavioural features, imbalance handling, and reproducible artifacts.
- Model
- XGBoost evaluation, probability scoring, frozen preprocessing, and threshold selection.
- Operations
- Alert-budget policy, serving surface, daily replay, paired metrics, and evidence visualisation.
04 / Research that changed the build
Research only matters here when it changed a decision.
- 01
Temporal leakage review
Random splits and future-derived aggregates can make fraud detection look stronger than it will behave on later transactions.
Feature construction and evaluation follow time, and the replay remains separate from the held-out model result. - 02
Alert-budget evaluation
Optimising ROC-AUC or a default threshold does not determine whether the resulting queue is operationally reviewable.
The operating point is selected and reported at a fixed 0.5 percent alert budget with precision and recall together. - 03
Dynamic-threshold experiments
Score distributions can shift across time, so a static threshold may violate volume or quality expectations.
Threshold behaviour and daily budget compliance became explicit replay outputs. - 04
Seven-day operational replay
The same system produced different precision and recall on the replay than on the held-out model test.
The two evaluations became separate claims with separate denominators and could no longer be collapsed into one number.
05 / Architecture
Choose and evaluate the threshold under an explicit alert budget, then replay it across time.
The pipeline builds temporal and behavioural features, trains the model, freezes production artifacts, and scores transactions through an API.
A separate replay measures the chosen operating point across consecutive days. Its result is never merged with the held-out test result.
- 01TransactionsChronological rows enter with historical behaviour only
- 02FeaturesTemporal and behavioural transforms follow the frozen contract
- 03ModelXGBoost returns a risk score rather than a final verdict
- 04Budget thresholdThe highest-risk 0.5 percent becomes the review queue
- 05ReplaySeven consecutive days record paired quality and budget compliance
06 / Decisions and trade-offs
What I chose, what I rejected, and what the choice costs.
Use the default probability threshold or optimise one model metric in isolation.
Recall remains low, while the alert volume stays tied to an operational capacity.
Recompute or retune the pipeline while evaluating the same replay window.
The replay cannot benefit from later tuning, while its result remains attributable to one production candidate.
Choose the more flattering precision value as the system's headline result.
The story contains more context, while each number keeps the dataset and question it actually answers.
07 / Evidence
Held-out model quality and operational replay answer different questions.
On an 85,429-row held-out test set, the UPI model reached 92.06% precision and 12.81% recall at a 0.5% alert budget.
85,429 held-out transactionsVerified 2026-08-28Across a 22,071-transaction seven-day replay, the UPI system recorded 75.22% precision, 12.13% recall, and no alert-budget violations.
22,071 transactions across 7 daysVerified 2026-08-28Held-out: 92.06 percent precision and 12.81 percent recall on 85,429 rows. Replay: 75.22 percent precision and 12.13 percent recall on 22,071 rows across seven days. These records remain separate.
08 / What failed
The failures are part of the architecture record.
01 Two precision values became one claim
- What I saw
- Earlier copy quoted a precision number without saying whether it came from held-out evaluation or operational replay.
- Why
- Different datasets and purposes were collapsed into one system-level headline.
- What changed
- The held-out and replay records now keep separate precision, recall, dates, and denominators.
- Still true
- Readers may still overvalue precision if recall and alert budget are separated visually.
02 A model metric ignored queue capacity
- What I saw
- Offline optimisation could select a threshold that produced more alerts than a team could review.
- Why
- The evaluation treated classification quality independently from the operating budget.
- What changed
- Threshold selection and reporting are anchored to a fixed 0.5 percent alert budget.
- Still true
- The chosen budget is a project assumption, not evidence from a real fraud operations team.
03 Replay performance fell below held-out performance
- What I saw
- Precision moved from 92.06 percent on held-out rows to 75.22 percent across the replay.
- Why
- Time-based operational conditions differ from the static held-out test distribution.
- What changed
- The replay result is published as a separate operational record rather than hidden or merged.
- Still true
- Seven days are not enough to establish long-term stability or drift behaviour.
09 / Limits and future
What the product cannot do yet, beside what may come next.
Current limitations
- The 0.5 percent alert budget is an explicit project operating assumption, not a customer-validated staffing limit.
- Recall is 12.81 percent on held-out rows and 12.13 percent in replay, so most fraudulent transactions are not captured at this budget.
- The seven-day replay is too short to establish seasonal drift, production stability, or long-term financial impact.
- The risk score prioritises review and is never presented as a final fraud verdict.
Deliberate boundaries
- Call a risk score a final fraud verdict.
- Hide recall to make precision look stronger.
Longer temporal replay
Run the frozen operating policy across a larger period and report drift, daily volume, precision, recall, and budget violations together.
Adaptive thresholds
Test dynamic threshold policies without allowing daily retuning to erase the precommitted alert-budget contract.
Human-review feedback
Model analyst decisions and queue outcomes before claiming operational impact or a final fraud determination.
10 / Stack and sources
The systems underneath it, and where this account comes from.
- Python
- XGBoost
- FastAPI
- feature engineering
- backtesting