# 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: tutorial

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>), [data](<https://devfeed.tech/topics/data.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>)

Tags: [declarative-programming](<https://devfeed.tech/tags/declarative-programming.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [feature](<https://devfeed.tech/tags/feature.md>), [feature-engineering](<https://devfeed.tech/tags/feature-engineering.md>), [fraud](<https://devfeed.tech/tags/fraud.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [paypal](<https://devfeed.tech/tags/paypal.md>), [production](<https://devfeed.tech/tags/production.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [scale](<https://devfeed.tech/tags/scale.md>)

## AI overview

PayPal describes its declarative, or config-based, feature engineering approach for machine learning. The approach lets data scientists declare feature definitions while execution details are handled separately, helping engineers address scale, predictable time to market, and total cost of ownership. The article introduces feature-cost metrics and strategies for reusing existing features.

## 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