# Declarative Feature Engineering at PayPal

DevFeed: [Declarative Feature Engineering at PayPal](<https://devfeed.tech/articles/declarative-feature-engineering-at-paypal-31933.md>)

Original publisher: [Read original article](<https://medium.com/paypal-tech/declarative-feature-engineering-at-paypal-eddcae81c06d?source=rss----6423323524ba---4>)

Author: Marina Lyan

Published: 2023-12-11T15:56:51Z

Content type: article

Language: en

Sources: [PayPal Technology](<https://devfeed.tech/sources/paypal-technology.md>)

Topics: [Feature Engineering](<https://devfeed.tech/topics/feature-engineering.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [feature-store](<https://devfeed.tech/topics/feature-store.md>), [self-service](<https://devfeed.tech/topics/self-service.md>), [Data pipelines](<https://devfeed.tech/topics/data-pipelines.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [airbnb](<https://devfeed.tech/tags/airbnb.md>), [config](<https://devfeed.tech/tags/config.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cost-analysis](<https://devfeed.tech/tags/cost-analysis.md>), [data-scientists](<https://devfeed.tech/tags/data-scientists.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [declarative-programming](<https://devfeed.tech/tags/declarative-programming.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [execution](<https://devfeed.tech/tags/execution.md>), [existing](<https://devfeed.tech/tags/existing.md>), [feature](<https://devfeed.tech/tags/feature.md>), [feature-engineering](<https://devfeed.tech/tags/feature-engineering.md>), [features](<https://devfeed.tech/tags/features.md>), [fraud](<https://devfeed.tech/tags/fraud.md>), [learning](<https://devfeed.tech/tags/learning.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [ml](<https://devfeed.tech/tags/ml.md>), [payment](<https://devfeed.tech/tags/payment.md>), [paypal](<https://devfeed.tech/tags/paypal.md>), [prevent-fraud](<https://devfeed.tech/tags/prevent-fraud.md>)

## AI overview

PayPal describes declarative feature engineering, which it calls config-based feature engineering, as letting data scientists specify what a feature should be while the system handles how to build it across batch, near-real-time, and real-time platforms. Its self-service UI and APIs support simulation, productization, historical backfills, and feature registration for reuse. Automation generates and optimizes pipelines, enforces point-in-time computation and engineering standards, and tracks time to market. The approach is aimed especially at simple features such as roll-up aggregations and categorical values, where standardized implementations can improve reuse, customization, cost estimation, and maintenance. More complex code-based features and analytical platforms for graphs, NLP, and anomaly detection are harder to standardize, customize, and maintain. PayPal presents the approach as effective for simple features at scale; the excerpt does not give quantitative results or the promised technical deep dive.

## Source excerpt

Photo by fabio on Unsplash PayPal supports over 400 million active consumers and merchants worldwide. Every minute there are several thousand payment transactions. To prevent fraud in real-time at such a scale, we need to streamline our ML workflow and feature engineering processes to build strong predictors of behaviors and risk indicators. On top of that, it must be done with consistently predictable Time to Market (TTM) and sustainable Total Cost of Ownership (TCO). What is declarative feature engineering? While the declarative feature engineering term was first introduced by Zipline AirBnB in 2019, we have successfully used this paradigm in PayPal for the last decade, though we know it as config-based feature engineering. The idea is to allow data scientists to write a declaration of what their features look like rather than explicitly specify how to construct them on top of different execution platforms. In this way, the concerns of feature construction and execution are abstracted away from scientists so that engineers can worry about those complexities. This post is the first in a series of two posts that will outline how the declarative feature engineering approach helps our engineers to address scale, TTM, and TCO requirements. Let's start with the definitions of metrics that measure our success. TTM of the ML Feature TTM of the Machine Learning (ML) feature is the length of time from the feature concept until it is released to production. Predictable TTM is a paramount need for overall AI maturation and business-first AI strategies. Cost of the ML Feature To qualify and estimate TCO, we break down the cost of the feature as follows: Layers of feature cost The main insight from the feature cost analysis is that we have to reuse existing features across the teams whenever possible. Otherwise, we just pay twice for every aspect. To approach the above challenges, we separate features into three levels of complexity so we can define tailored strategies for scal