关于
This skill builds a Feast-based feature store for centralized ML feature management. It configures offline/online stores for batch and real-time serving, defines feature views with transformations, and ensures point-in-time correct joins. Use it to maintain training-serving consistency, serve low-latency features, and reuse definitions across multiple models.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/build-feature-store在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
建特徵庫
詳 Extended Examples 備配檔與模。
以 Feast 施中央特徵管,跨訓與推行一致特徵供。
用
- 跨隊多 ML 模管特徵
- 保訓供之特徵一致
- 施點時正確之史特徵
- 實時推供低延特徵
- 跨案用特徵定
- 特徵轉版
- 建特徵錄為發現與治
- 訓管中防特徵洩
入
- 必:原資源(庫、湖、倉)
- 必:裝 Feast 之 Python 環
- 必:離線庫(BigQuery、Snowflake、Redshift 或 Parquet 檔)
- 必:線上庫(Redis、DynamoDB、Cassandra 或開發之 SQLite)
- 可:特徵轉邏(Python、SQL、Spark)
- 可:實鍵定(user_id、product_id 等)
- 可:Feast 服發之 Kubernetes 集
行
一:初 Feast 特徵庫
設 Feast 案構與配存後端。
# Install Feast with required extras
pip install 'feast[redis,postgres]' # Add backends as needed
# Initialize new feature repository
feast init my_feature_repo
cd my_feature_repo
# Directory structure created:
# my_feature_repo/
# ├── feature_store.yaml # Configuration
# ├── features.py # Feature definitions
# └── data/ # Sample data (dev only)
配 feature_store.yaml:
# feature_store.yaml
project: customer_analytics
registry: data/registry.db # SQLite for dev, use S3/GCS for prod
provider: local
# Offline store for training data
offline_store:
type: postgres
# ... (see EXAMPLES.md for complete implementation)
產環配附雲端後端:
# feature_store.prod.yaml
project: customer_analytics
registry: s3://feast-registry/prod/registry.db
provider: aws
offline_store:
type: bigquery
project_id: my-gcp-project
# ... (see EXAMPLES.md for complete implementation)
得: Feast 庫已初附配檔、例特徵定已造、離線與線上庫已配、註徑可達。
敗: 驗庫/Redis 證(psql -U feast_user -h localhost)、察連串格、確庫存(CREATE DATABASE feature_store)、驗 S3/BigQuery/DynamoDB 雲權、試連存後端、察 Feast 版合後端(feast version)。
二:定實與資源
造實定並連至原資源。
# entities.py
from feast import Entity, ValueType
# Define entities (primary keys for features)
customer = Entity(
name="customer",
description="Customer entity",
value_type=ValueType.INT64,
# ... (see EXAMPLES.md for complete implementation)
定資源:
# data_sources.py
from feast import FileSource, BigQuerySource, RedshiftSource
from feast.data_format import ParquetFormat
from datetime import timedelta
# Development: File-based source
customer_transactions_source = FileSource(
path="data/customer_transactions.parquet",
# ... (see EXAMPLES.md for complete implementation)
得: 實定引正 ID 列、資源連原資成、event_timestamp_column 存於源資、created_timestamp_column 允點時查。
敗: 驗源檔存且可讀、察 BigQuery/Redshift 證與表存、確時戳列格正(Unix 時戳或 ISO8601)、驗 Kafka 連與主存、察源與實之綱合。
三:以轉定特徵視
造特徵視,定原資如何成 ML 備之特徵。
# feature_views.py
from feast import FeatureView, Field
from feast.types import Float32, Int64, String, Bool
from datetime import timedelta
from entities import customer, product
from data_sources import customer_features_source
# Simple feature view without transformations
# ... (see EXAMPLES.md for complete implementation)
得: 特徵視成註、綱合源資、轉無誤行、TTL 合用例、需求視合批與請特徵。
敗: 驗欄名全合源列、察類合(Int64 對 Int32)、確實引存、以例資驗轉邏、察算中除零、驗請源綱合推載。
四:施特徵定與物化
發特徵定至註並物化至線上庫。
# Apply feature definitions to registry
feast apply
# Expected output:
# Created entity customer
# Created feature view customer_stats
# Created on demand feature view customer_segments
# ... (see EXAMPLES.md for complete implementation)
程物化:
# materialize_features.py
from feast import FeatureStore
from datetime import datetime, timedelta
# Initialize feature store
fs = FeatureStore(repo_path=".")
# Materialize all feature views
# ... (see EXAMPLES.md for complete implementation)
得: 特徵定無撞施於註、物化務成完、線上庫以特徵充、特徵新於配 TTL 內。
敗: 察離線庫查成(feast feature-views describe customer_stats)、驗時範有資、確線上庫可書(Redis/DynamoDB 權)、察跨視複特徵名、驗實鍵存源資、監物化務志、察本庫磁空。
五:取訓特徵
取點時正確之史特徵為模訓。
# get_training_data.py
from feast import FeatureStore
import pandas as pd
from datetime import datetime
# Initialize feature store
fs = FeatureStore(repo_path=".")
# ... (see EXAMPLES.md for complete implementation)
點時正確驗:
# validate_pit_correctness.py
import pandas as pd
from datetime import datetime, timedelta
def validate_point_in_time_correctness(training_df, entity_df):
"""
Ensure features don't leak future information.
"""
# ... (see EXAMPLES.md for complete implementation)
得: 史特徵成取、entity_df 時戳存、物化特徵無 NaN、點時正確保(無未來資洩)、特徵服邏集特徵。
敗: 察 entity_df 有必列(實名 + event_timestamp)、驗特徵視名合註、確離線庫有所請時範資、察時區不合(用 UTC)、驗實 ID 存源資、察 SQL 誤志、驗特徵視 TTL 涵所請時範。
六:實時推供特徵
自線上庫取低延特徵為模供。
# serve_features.py
from feast import FeatureStore
import time
# Initialize feature store
fs = FeatureStore(repo_path=".")
def get_inference_features(customer_ids: list, request_data: dict = None):
# ... (see EXAMPLES.md for complete implementation)
FastAPI 整:
# api.py
from fastapi import FastAPI
from pydantic import BaseModel
from feast import FeatureStore
import mlflow
app = FastAPI()
fs = FeatureStore(repo_path=".")
# ... (see EXAMPLES.md for complete implementation)
得: 單實線上特徵於 <10ms 取、批取效縮、需求轉正行、請時特徵合批特徵、API 速應(<50ms 全程)。
敗: 察線上庫已充(空則物化)、驗 Redis/DynamoDB 連與延、確實鍵存線上庫、察冷起(暖快)、驗需求轉邏、監線上庫記/CPU、察服與線上庫間網延。
驗
- Feast 庫初且配
- 離線與線上庫成連
- 實定合源資
- 特徵視註於註
- 需求轉正行
- 物化無誤完
- 史特徵以點時正確取
- 線上特徵低延供(<10ms)
- 特徵新於配 TTL 內
- 訓供一致已驗
- 特徵錄可發現
忌
- 特徵洩:史特徵中用未來資—必驗點時正確,用 created_timestamp 列
- 轉不一:訓對供異邏—用 Feast 需求視保一致
- 陳特徵:線上庫非規物化—設排物化務(cron/Airflow)
- 缺實鍵:訓集實不在線上庫—確全物化,雅處缺鍵
- 類不合:綱類不合源資—施前驗類,用顯 Field 定
- 緩線上取:網延或線上庫載—特徵庫近推服,用連池
- 大特徵視:物化百萬實緩—按日分、增量物化、優離線查
- 無特徵版:破改影產模—版特徵視、保後容
- 時區混:混時區致誤合—時戳必 UTC
- 略 TTL:供過期特徵—設宜 TTL,監特徵新
參
track-ml-experiments— MLflow 實驗中錄特徵元資orchestrate-ml-pipeline— 排特徵物化務version-ml-data— 特徵工之原資版deploy-ml-model-serving— 特徵庫與模供整serialize-data-formats— 特徵擇效存格design-serialization-schema— 特徵源之綱設
GitHub 仓库
Frequently asked questions
What is the build-feature-store skill?
build-feature-store is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform build-feature-store-related tasks without extra prompting.
How do I install build-feature-store?
Use the install commands on this page: add build-feature-store to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does build-feature-store belong to?
build-feature-store is in the Meta category, tagged ai and design.
Is build-feature-store free to use?
Yes. build-feature-store is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
相关推荐技能
Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
