Dec 07, 2023
20 min read
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).
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 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.
To qualify and estimate TCO, we break down the cost of the feature as follows:
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 scale, TTM, and TCO at every level.
Simple features
Simple features account for the majority of the features, e.g. — roll-up aggregations (sum, count, average), and categorical features (marital status). For example:
Benefits include easier:
Code-based features
For more complex analytics, we plan for side-by-side development to reduce the number of iterations between data scientists and software engineers. However, it’s more challenging to:
Analytical platforms for feature generation
For state-of-the-art feature generation, we develop graph of customers, Natural language processing (NLP), and anomaly detection analytical platforms.
These platforms, however, are the most difficult to customize and maintain due to their high complexity.
Simple features are the perfect fit for the declarative feature engineering paradigm. Data scientists can write a declaration of what their features look like rather than explicitly specify how to construct them on top of different execution platforms: batch/near-real-time or real-time, which are standard compute platforms in the industry
We provide data scientists with UI and APIs to specify logic in a declarative way, simulate (aka Time Travel for feature), and productize features without direct support from engineers. This drastically reduces project planning overhead by reducing timeline dependencies, thus improving TTM.
Behind the scenes, the system is responsible for:
The declarative feature engineering paradigm has proven to be very effective in simple feature development at scale with a predictable Time to Market and sustainable Total Cost of Ownership. We put our focus on self-service and automation for declarative features which allow us to free up engineers’ precious time to concentrate on state-of-the-art next-generation AI projects.
In this post, we outlined our solution’s functionality, and in the subsequent post, we will do a deep dive into the technical aspects. Stay tuned!