Python SDK for Feast
Project description
Overview
Feast (Feature Store) is an open source feature store for machine learning. Feast is the fastest path to manage existing infrastructure to productionize analytic data for model training and online inference.
Feast allows ML platform teams to:
- Make features consistently available for training and serving by managing an offline store (to process historical data for scale-out batch scoring or model training), a low-latency online store (to power real-time prediction), and a battle-tested feature server (to serve pre-computed features online).
- Avoid data leakage by generating point-in-time correct feature sets so data scientists can focus on feature engineering rather than debugging error-prone dataset joining logic. This ensure that future feature values do not leak to models during training.
- Decouple ML from data infrastructure by providing a single data access layer that abstracts feature storage from feature retrieval, ensuring models remain portable as you move from training models to serving models, from batch models to realtime models, and from one data infra system to another.
Please see our documentation for more information about the project.
📐 Architecture
The above architecture is the minimal Feast deployment. Want to run the full Feast on Snowflake/GCP/AWS? Click here.
🐣 Getting Started
1. Install Feast
pip install feast
2. Create a feature repository
feast init my_feature_repo
cd my_feature_repo
3. Register your feature definitions and set up your feature store
feast apply
4. Explore your data in the web UI (experimental)
feast ui
5. Build a training dataset
from feast import FeatureStore
import pandas as pd
from datetime import datetime
entity_df = pd.DataFrame.from_dict({
"driver_id": [1001, 1002, 1003, 1004],
"event_timestamp": [
datetime(2021, 4, 12, 10, 59, 42),
datetime(2021, 4, 12, 8, 12, 10),
datetime(2021, 4, 12, 16, 40, 26),
datetime(2021, 4, 12, 15, 1 , 12)
]
})
store = FeatureStore(repo_path=".")
training_df = store.get_historical_features(
entity_df=entity_df,
features = [
'driver_hourly_stats:conv_rate',
'driver_hourly_stats:acc_rate',
'driver_hourly_stats:avg_daily_trips'
],
).to_df()
print(training_df.head())
# Train model
# model = ml.fit(training_df)
event_timestamp driver_id conv_rate acc_rate avg_daily_trips
0 2021-04-12 08:12:10+00:00 1002 0.713465 0.597095 531
1 2021-04-12 10:59:42+00:00 1001 0.072752 0.044344 11
2 2021-04-12 15:01:12+00:00 1004 0.658182 0.079150 220
3 2021-04-12 16:40:26+00:00 1003 0.162092 0.309035 959
6. Load feature values into your online store
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S")
feast materialize-incremental $CURRENT_TIME
Materializing feature view driver_hourly_stats from 2021-04-14 to 2021-04-15 done!
7. Read online features at low latency
from pprint import pprint
from feast import FeatureStore
store = FeatureStore(repo_path=".")
feature_vector = store.get_online_features(
features=[
'driver_hourly_stats:conv_rate',
'driver_hourly_stats:acc_rate',
'driver_hourly_stats:avg_daily_trips'
],
entity_rows=[{"driver_id": 1001}]
).to_dict()
pprint(feature_vector)
# Make prediction
# model.predict(feature_vector)
{
"driver_id": [1001],
"driver_hourly_stats__conv_rate": [0.49274],
"driver_hourly_stats__acc_rate": [0.92743],
"driver_hourly_stats__avg_daily_trips": [72]
}
📦 Functionality and Roadmap
The list below contains the functionality that contributors are planning to develop for Feast.
-
We welcome contribution to all items in the roadmap!
-
Have questions about the roadmap? Go to the Slack channel to ask on #feast-development.
-
Data Sources
-
Offline Stores
-
Online Stores
-
Feature Engineering
-
Streaming
-
Deployments
-
Feature Serving
-
Data Quality Management (See RFC)
- Data profiling and validation (Great Expectations)
-
Feature Discovery and Governance
- Python SDK for browsing feature registry
- CLI for browsing feature registry
- Model-centric feature tracking (feature services)
- Amundsen integration (see Feast extractor)
- DataHub integration (see DataHub Feast docs)
- Feast Web UI (Beta release. See docs)
🎓 Important Resources
Please refer to the official documentation at Documentation
👋 Contributing
Feast is a community project and is still under active development. Please have a look at our contributing and development guides if you want to contribute to the project:
- Contribution Process for Feast
- Development Guide for Feast
- Development Guide for the Main Feast Repository
✨ Contributors
Thanks goes to these incredible people:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for feast-0.26.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a39cffd4c4402dfe13504845e1756de44bb1b1522f704734e4ee116a7e88312 |
|
MD5 | 63d1b392a2bc3b4275fd50a927f09b73 |
|
BLAKE2b-256 | 7d5de19c6494c9f7167d623586f1295134c81c00fdead4fb4bc7d36b6f2b3368 |
Hashes for feast-0.26.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d56cfe0337fc874ed2e714dee8943042903d10160d9c0904ab2fad8d1c4294fa |
|
MD5 | b7b7f6a77508c18cdf203cf295223e5f |
|
BLAKE2b-256 | 1d357191ac159888e73f6a7a6dc37e65fb8666bdb5e7f83ca7d84b673b0fe97e |
Hashes for feast-0.26.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7958ec511441d314813073729046f671921ccf6dfdad8032b85d860243462a6a |
|
MD5 | a266c1f04b59c9b88585ed24f8a834f8 |
|
BLAKE2b-256 | e86840cf40ed0f2991d6f21ed47d28029a3601d77f823a8cda6f3b251669ee14 |
Hashes for feast-0.26.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b71054927c82dc302e1eae3b0735d06b19b2b8acc24c38b3bed7aa827e1b290 |
|
MD5 | 1f79f785825d99e43a7e7c56ebab3463 |
|
BLAKE2b-256 | c0f98cee657a063ec3bc397db01db7b3c8afd84c439a6cdfeddde6f28c2947cd |
Hashes for feast-0.26.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 634d6617fd60618892e6595b861fc6a5e0c226511d491291cbd3bc48e2c866b9 |
|
MD5 | 25012c76a7493e0f103b193d7929bc84 |
|
BLAKE2b-256 | 6dc339ed6af14d25041a786a73d692594dab5f61652a38ef223af2be1deab437 |
Hashes for feast-0.26.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c4529f205ae23025d0977b5ea955d008e198f7b69dfa4b0ce555fe524c859b3 |
|
MD5 | 815b0020aaf7bf29abfaa09d7a0c1ff4 |
|
BLAKE2b-256 | c7803eaa49a6f754b7adcd3e2a77ed83c40d19a62720353e9330bb7b0a337d67 |