Learn Everything

Paths/MLOps Engineer/Feature Stores / Defining Features

Guided Taskbeginnerubuntu:24.04Ask AI

Define a Feature View

A feature view names the entity, the features and where the data comes from. Write the definition for a user activity feature set.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • Directory ~/feast exists○
  • File ~/feast/feature_repo.yaml exists○
  • The config declares the project and the provider○
  • The config defines a feature view with an entity and features○

02Walkthrough

6 steps
  1. 01

    Create the feast directory

    The feature repository is a project of its own - keep it out of the serving code.

    mkdir ~/feast
  2. 02

    Write the repository config

    project names the repository, provider says where the data lives and online_store says where the fresh values are served from.

    echo 'project: acme-orders\nprovider: local\nregistry: data/registry.db\nonline_store:\n type: sqlite\n path: data/online_store.db\nentity_key_serialization_version: 2' > ~/feast/feature_repo.yaml
  3. 03

    Add the entity

    The entity is the thing every row is about - the user, the order, the device. Get it wrong and every join is wrong.

    echo 'entity:\n name: user\n join_keys:\n - user_id\n value_type: INT64' >> ~/feast/feature_repo.yaml
  4. 04

    Add the feature view

    A feature view is a named, versioned set of features. The schema of the view is the contract between training and serving.

    echo 'feature_view:\n name: user_activity\n entity: user\n schema:\n - name: sessions_7d\n type: INT64\n - name: spend_30d\n type: FLOAT\n - name: last_seen\n type: DATETIME' >> ~/feast/feature_repo.yaml
  5. 05

    Verify the definition

    cat prints the repository config. Every feature here needs an owner.

    cat ~/feast/feature_repo.yaml
  6. 06

    Submit for validation

    The validator checks the project, the provider, the entity and the features.

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list