Define Feature Views with Feast
Declare entities and features in a registry.
Define Feature Views with Feast is a free MLOps Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MLOps Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Building Blocks
In Feast you describe features with code: an Entity, a data source, and a Feature View. Get these three right and the rest follows. 🏗️
What an Entity Is
An Entity is the thing your features describe, like a driver or a customer. It is the key you will look features up by later.
driver = Entity(name="driver", join_keys=["driver_id"])Point at Your Data
A data source tells Feast where the raw feature values live, such as a Parquet file or a warehouse table.
src = FileSource(path="driver_stats.parquet", timestamp_field="event_timestamp")The Feature View
A FeatureView groups related features for one entity and links them to a source. It is the heart of a Feast definition.
Declaring Fields
Inside a Feature View, each Field names a feature and its data type, so Feast knows the schema it will serve.
Field(name="conv_rate", dtype=Float32)Putting It Together
One Feature View ties the entity, schema, and source into a single object Feast can manage. 🔗
fv = FeatureView(name="driver_stats", entities=[driver], schema=[Field(name="conv_rate", dtype=Float32)], source=src)The TTL Window
A Feature View's ttl sets how long a value stays valid. Past that window, Feast treats the feature as missing rather than stale.
ttl=timedelta(days=1)The Timestamp Column
Every source needs an event timestamp column. It records when each value was true, which makes time-correct lookups possible.
The Feature Repo
Your definitions live in a feature repo folder with a feature_store.yaml config. Feast scans Python files there to find your objects.
Apply the Definitions
Running feast apply registers your entities and feature views into the registry. Nothing is live until you apply.
feast applyThe Registry
The registry is Feast's catalog of every entity and feature view. Teammates query it to discover what features already exist. 📒
Quick Check
Which object does a Feature View group features around?
Recap
You defined Feast objects: an Entity, a source, and a Feature View with fields and a ttl, then ran feast apply to register them. Next, you'll serve them online.
Frequently asked questions
Is the “Define Feature Views with Feast” lesson free?
Yes — the full text of “Define Feature Views with Feast” is free to read here on the web, and the MLOps Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MLOps Academy course, upgrade to CoddyKit PRO.
What will I learn in “Define Feature Views with Feast”?
Declare entities and features in a registry. You practise MLOps Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start MLOps Academy?
No prior experience is required. MLOps Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Define Feature Views with Feast” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this MLOps Academy lesson?
Yes. Every MLOps Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why Feature Stores Exist
- Define Feature Views with Feast
- Materialize Features to an Online Store
- Fetch Point-in-Time Correct Features