Real-time fraud detection needs three feature types: recent activity (e.g., five-minute transaction count), spending baselines (30-day average and standard deviation), and current payment details. Databricks Feature Views address this by defining each feature once for both training and serving, producing point-in-time correct training data and online inference pipelines. The walkthrough follows a $900 payment from a Kafka stream through RollingWindow and SawtoothWindow aggregations to a fraud score from Model Serving. Feature Views prevent training-serving skew and data leakage; on-demand features compare the current amount against stored baselines at request time. Unity Catalog governs definitions, permissions, and lineage, while MLflow records model dependencies and Model Serving retrieves features from the Online Feature Store.
Context
Real-time fraud detection requires features from recent activity, spending baselines, and current payment details, computed consistently for training and serving to avoid training-serving skew and data leakage.
Approach / What changed
Define features once using Databricks Feature Views with a single API covering batch, streaming, and on-demand features. Use RollingWindow for short-term aggregates (e.g., five-minute transaction count), SawtoothWindow for long-term baselines (e.g., 30-day average and standard deviation), and on-demand features for request-time comparisons (e.g., comparing current amount against stored baselines). Materialize features to the Online Feature Store via managed pipelines, and serve them through Model Serving with Unity Catalog governance.
Takeaways
1
Shared feature definitions for training and serving reduce training-serving skew that comes from separate implementations.
2
Point-in-time correct training windows that exclude future events prevent data leakage and keep offline metrics honest.
3
Managed materialization pipelines keep features fresh in the Online Feature Store, so teams focus on choosing better fraud signals rather than building infrastructure.
FAQ
What are Databricks Feature Views?
Feature Views are a capability of Databricks Feature Store for defining ML features once and using them for both training and production. Each definition specifies a source, entity keys, time semantics and a transformation, and Unity Catalog governs them.
How do Feature Views prevent data leakage when training a fraud model?
Feature Views compute each training example's features as of that example's timestamp. For a payment at 10:00 AM, a five-minute transaction count includes payments from 9:55 AM up to, but not including, 10:00 AM, keeping future activity out of the training data.
What is training-serving skew and how do Feature Views reduce it?
Training-serving skew occurs when features are computed one way for training and another way for live inference. Feature Views reduce it by using one registered definition for both historical computation and online materialization, so teams don't reimplement feature logic for production.
An AI runtime is the execution layer between model code and hardware: it feeds data to accelerators, places and reshards tensors, schedules work, and holds latency steady. Here are its four core jobs.
Classification is a gate, not a label: a fast model scores each incoming signal, and only the ambiguous cases escalate to expensive reasoning. This map shows the layers, the decision boundary, and the feedback loop.
Clairic is a System One extraction model that turns unstructured input into typed values in a single forward pass. This five-step flow shows how to declare fields, call it, and use the results.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.