pip install feast
feast init my_features
cd my_featuresfrom feast import Entity, FeatureView, FileSource, Field
from feast.types import Float32, Int64
from datetime import timedelta
customer = Entity(name="customer_id", join_keys=["customer_id"])
customer_source = FileSource(
path="data/customer_features.parquet",
timestamp_field="event_timestamp",
)
customer_fv = FeatureView(
name="customer_features",
entities=[customer],
ttl=timedelta(days=1),
schema=[
Field(name="lifetime_value", dtype=Float32),
Field(name="total_orders", dtype=Int64),
],
source=customer_source,
)# Initial materialization
feast materialize 2024-01-01T00:00:00 2024-12-31T00:00:00
# Incremental (from last run to now)
feast materialize-incremental $(date -u +%Y-%m-%dT%H:%M:%S)from feast import FeatureStore
store = FeatureStore(repo_path=".")
# Online (for serving)
features = store.get_online_features(
features=["customer_features:lifetime_value"],
entity_rows=[{"customer_id": 123}],
)
# Offline (for training)
training_df = store.get_historical_features(
entity_df=entity_df,
features=["customer_features:lifetime_value"],
)Get the full Feature Store Setup Guide and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.