Skip to content
Back to projects
Data Science “Deploying intelligent applications” course · EMSI Rabat (5th year) · 2026

MLOps: fraud detection

Take a fraud-detection model all the way to production and choose, on measured criteria, between an AutoML model and a hand-built one.

~33 ms p95 latency (vs 100–220 ms)
46× smaller (0.29 MB vs 13.37 MB)
0,858 F1 (vs 0.867)

Problem

The most useful model in production is not always the most accurate one: it also has to respond fast, stay lightweight and be replaceable safely. Here two models follow the same MLOps path, from training to serving.

Data

  • Synthetic dataset regenerated by a script with a fixed seed: no data is versioned in the repository

Approach

  • AutoML: FLAML with a 90 s budget, which selects an XGBoost classifier
  • Manual baseline: Random Forest with 500 trees, depth 16
  • Both models registered in the MLflow Model Registry and promoted with a “production” alias
  • REST serving through MLflow and an external client: 200 timed calls, median and p95
  • Second repository (fraude-prefect-ci): DVC pipeline, Prefect flow, scheduling and GitHub CI

Results

  • Test F1: 0.867 (manual) vs 0.858 (AutoML)
  • Median latency: ~56 ms vs 8–25 ms; p95: 100–220 ms vs ~33 ms
  • Size: 13.37 MB vs 0.29 MB
  • Decision: AutoML goes to production at the cost of about 1% F1; rollback is a single alias change

What I would improve

  • Replace the synthetic data with a real, imbalanced transaction dataset
  • Monitor data drift and trigger retraining from the Prefect flow
Enlarged image