本文へ移動
cccskills
無料GitHub で公開日本語紹介

feast-user-guide

Feastで特徴量の定義や保存先の設定、オンライン・履歴データの取得、ベクトル検索を使ったRAG用データ検索まで進める方法を案内します。

原文原文の説明を見る

Guide for working with Feast (Feature Store) — defining features, configuring feature_store.yaml, retrieving features online/offline, using the CLI, and building RAG retrieval pipelines. Use when the user asks about creating entities, feature views, on-demand feature views, stream feature views, feature services, data sources, feature_store.yaml configuration, feast apply/materialize commands, online or historical feature retrieval, or vector-based document retrieval with Feast.

feast-dev/feastスター 7,347(GitHub 7,347 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 特徴量を定義・登録したいとき
  • オンライン特徴量を取得したいとき
  • 学習用の履歴データを用意したいとき
  • FeastでRAG検索を組みたいとき

日本語での紹介

できること

Feastの特徴量ストアを扱うための基本的な手順を確認できます。Entity、Data Source、FeatureView、OnDemandFeatureView、FeatureServiceの役割や定義方法を示し、feature_store.yamlの設定例も掲載しています。feast applyによる定義の登録、オンラインストアへのマテリアライズ、CLIでの一覧確認も扱います。Python APIを使った低遅延のオンライン取得や、学習用データとして過去時点の特徴量を取得する方法も説明します。ベクトル検索向けのFeatureViewを定義し、類似する文書を取得する例も含まれています。

こんなときに便利

Feastを初めて使うときや、特徴量の登録から取得までの流れを確認したいときに役立ちます。オンライン推論用のデータと学習用の履歴データをどう取得するか調べたい場合や、Feastを使ったRAG検索の構成を検討するときにも参照できます。

使い方の例

  • 「顧客の特徴量を定義して、オンラインで取得する例を教えて」
  • 「feature_store.yamlの最小構成とfeast applyの使い方を説明して」
  • 「Feastでベクトル検索を使って関連文書を取得する方法を教えて」

注意点

ライセンスはApache-2.0です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(8)

  • SKILL.md6.9 KB
  • feast-architecture/SKILL.md16.5 KB
  • feast-dev/SKILL.md5.0 KB
  • feast-testing/SKILL.md9.0 KB
  • feast-user-guide/SKILL.md6.9 KB
  • references/configuration.md7.0 KB
  • references/feature-definitions.md10.1 KB
  • references/retrieval-and-rag.md8.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Feast User Guide

Quick Start

A Feast project requires:

  1. A feature_store.yaml config file
  2. Python files defining entities, data sources, feature views, and feature services
  3. Running feast apply to register definitions
feast init my_project
cd my_project
feast apply

Core Concepts

Entity

An entity is a collection of semantically related features (e.g., a customer, a driver). Entities have join keys used to look up features.

from feast import Entity
from feast.value_type import ValueType

driver = Entity(
    name="driver_id",
    description="Driver identifier",
    value_type=ValueType.INT64,
)

Data Sources

Data sources describe where raw feature data lives.

from feast import FileSource, BigQuerySource, KafkaSource, PushSource, RequestSource
from feast.data_format import ParquetFormat

# Batch source (file)
driver_stats_source = FileSource(
    name="driver_stats_source",
    path="data/driver_stats.parquet",
    timestamp_field="event_timestamp",
    created_timestamp_column="created",
)

# Request source (for on-demand features)
input_request = RequestSource(
    name="vals_to_add",
    schema=[Field(name="val_to_add", dtype=Float64)],
)

FeatureView

Maps features from a data source to entities with a schema, TTL, and online/offline settings.

from feast import FeatureView, Field
from feast.types import Float32, Int64, String
from datetime import timedelta

driver_hourly_stats = FeatureView(
    name="driver_hourly_stats",
    entities=[driver],
    ttl=timedelta(days=365),
    schema=[
        Field(name="conv_rate", dtype=Float32),
        Field(name="acc_rate", dtype=Float32),
        Field(name="avg_daily_trips", dtype=Int64),
    ],
    online=True,
    source=driver_stats_source,
)

OnDemandFeatureView

Computes features at request time from other feature views and/or request data.

from feast import on_demand_feature_view
import pandas as pd

@on_demand_feature_view(
    sources=[driver_hourly_stats, input_request],
    schema=[Field(name="conv_rate_plus_val", dtype=Float64)],
    mode="pandas",
)
def transformed_conv_rate(inputs: pd.DataFrame) -> pd.DataFrame:
    df = pd.DataFrame()
    df["conv_rate_plus_val"] = inputs["conv_rate"] + inputs["val_to_add"]
    return df

FeatureService

Groups features from multiple views for retrieval.

from feast import FeatureService

driver_fs = FeatureService(
    name="driver_ranking",
    features=[driver_hourly_stats, transformed_conv_rate],
)

Feature Retrieval

Online (low-latency)

from feast import FeatureStore

store = FeatureStore(repo_path=".")

features = store.get_online_features(
    features=[
        "driver_hourly_stats:conv_rate",
        "driver_hourly_stats:acc_rate",
    ],
    entity_rows=[{"driver_id": 1001}, {"driver_id": 1002}],
).to_dict()

Historical (training data with point-in-time joins)

entity_df = pd.DataFrame({
    "driver_id": [1001, 1002],
    "event_timestamp": [datetime(2023, 1, 1), datetime(2023, 1, 2)],
})

training_df = store.get_historical_features(
    entity_df=entity_df,
    features=["driver_hourly_stats:conv_rate", "driver_hourly_stats:acc_rate"],
).to_df()

Or use a FeatureService:

training_df = store.get_historical_features(
    entity_df=entity_df,
    features=driver_fs,
).to_df()

Materialization

Load features from offline store into online store:

# Full materialization over a time range
feast materialize 2023-01-01T00:00:00 2023-12-31T23:59:59

# Incremental (from last materialized timestamp)
feast materialize-incremental $(date -u +"%Y-%m-%dT%H:%M:%S")

Python API:

from datetime import datetime
store.materialize(start_date=datetime(2023, 1, 1), end_date=datetime(2023, 12, 31))
store.materialize_incremental(end_date=datetime.utcnow())

CLI Commands

CommandPurpose
feast init [DIR]Create new feature repository
feast applyRegister/update feature definitions
feast planPreview changes without applying
feast materialize START ENDMaterialize features to online store
feast materialize-incremental ENDIncremental materialization
feast entities listList registered entities
feast feature-views listList feature views
feast feature-services listList feature services
feast on-demand-feature-views listList on-demand feature views
feast teardownRemove infrastructure resources
feast versionShow SDK version

Options: --chdir / -c (run in different directory), --feature-store-yaml / -f (override config path).

Vector Search / RAG

Define a feature view with vector fields for similarity search:

from feast.types import Array, Float32

wiki_passages = FeatureView(
    name="wiki_passages",
    entities=[passage_entity],
    schema=[
        Field(name="passage_text", dtype=String),
        Field(
            name="embedding",
            dtype=Array(Float32),
            vector_index=True,
            vector_length=384,
            vector_search_metric="COSINE",
        ),
    ],
    source=passages_source,
    online=True,
)

Retrieve similar documents:

results = store.retrieve_online_documents(
    feature="wiki_passages:embedding",
    query=query_embedding,
    top_k=5,
)

feature_store.yaml Minimal Config

project: my_project
registry: data/registry.db
provider: local
online_store:
  type: sqlite
  path: data/online_store.db

Common Imports

from feast import (
    Entity, FeatureView, OnDemandFeatureView, FeatureService,
    Field, FileSource, RequestSource, FeatureStore,
)
from feast.on_demand_feature_view import on_demand_feature_view
from feast.types import Float32, Float64, Int64, String, Bool, Array
from feast.value_type import ValueType
from datetime import timedelta

Detailed References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

feast-architecture

無料概要あり

Feastの主要コンポーネントやデータの流れ、関連するコードの場所を把握し、機能の仕組みや変更箇所を調べるためのスキルです。

  • `feast apply`の処理を理解したいとき
  • レジストリの保存方式を調べたいとき
  • 特徴量データの流れを追いたいとき
feast-dev/feast7,3472026年10月25日 更新

feast-dev

無料概要あり

Feastへの開発参加に向けて、環境構築、テスト、Lint、コード構成、ドキュメント配置やPR作成の手順を確認できます。

  • Feastの開発環境を準備したいとき
  • 変更前後のテストやLintを確認したいとき
  • 新しいストアの追加場所を調べたいとき
feast-dev/feast7,3472026年10月25日 更新

feast-testing

無料概要あり

Feastのテスト実行や新規コンポーネントの単体テスト作成、レジストリやオンラインストアの不具合調査を支援する開発スキルです。

  • 変更箇所のテストを実行したいとき
  • 新しいコンポーネントの単体テストを書くとき
  • レジストリの不整合を調べたいとき
feast-dev/feast7,3472026年10月25日 更新

feast-dev のスキルをすべて見る

このスキルの問題を報告する