Community研究与数据分析github.com

Unknown-333/building-feature-pipelines

Build ML feature pipelines and feature stores — point-in-time-correct joins to avoid label leakage, offline/online parity, feature freshness and backfills, and materialization with tools like Feast. Use when engineering features for ML, preventing train/serve skew or data leakage, building a feature store, or backfilling historical features for training.

building-feature-pipelines 是什么?

building-feature-pipelines is a Claude Code agent skill that build ML feature pipelines and feature stores — point-in-time-correct joins to avoid label leakage, offline/online parity, feature freshness and backfills, and materialization with tools like Feast. Use when engineering features for ML, preventing train/serve skew or data leakage, building a feature store, or backfilling historical features for training.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Unknown-333/awesome-data-engineering-skills/tree/main/skills/building-feature-pipelines

Installed? Explore more 研究与数据分析 skills: obra/superpowers, affaan-m/quarkus-verification, affaan-m/uspto-database · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Building Feature Pipelines

When to use

  • Engineering features for ML models from warehouse/stream data.
  • Preventing label leakage and train/serve skew.
  • Setting up a feature store, online serving, or historical backfills.
  • Do NOT use for general modeling/aggregation (use dbt/Spark skills) unless it feeds ML features.

Workflow

- [ ] Define each feature with an entity key and an event timestamp
- [ ] Build training sets with point-in-time-correct joins (as-of the label time)
- [ ] Share ONE definition for offline (training) and online (serving)
- [ ] Set freshness/materialization for online features
- [ ] Backfill historical features idempotently for training
  1. Point-in-time correctness. Join features as of each label's timestamp — use only data that was known before the prediction time. This prevents label leakage, the most damaging feature bug.
  2. Offline/online parity. Compute a feature the same way for training (offline, batch) and serving (online, low-latency). Divergent logic causes train/serve skew and silent production degradation.
  3. Freshness. Online features must be materialized on a schedule that meets the model's staleness tolerance.
  4. Idempotent backfills. Recomputing historical features must be repeatable (see designing-backfills-and-replays).

Patterns

Point-in-time (as-of) join — pick the latest feature value strictly before each label event:

SELECT l.entity_id, l.label_ts, f.value AS feature
FROM labels l
LEFT JOIN features f
  ON f.entity_id = l.entity_id
 AND f.event_ts <= l.label_ts          -- only past data; no leakage
QUALIFY ROW_NUMBER() OVER (
  PARTITION BY l.entity_id, l.label_ts ORDER BY f.event_ts DESC) = 1;

Single definition, two paths — define the feature once (e.g. Feast FeatureView); materialize to an offline store for training and an online store for serving so both use identical logic.

Freshness + materialization — schedule online materialization; monitor feature freshness like any dataset SLA (implementing-pipeline-observability).

Common pitfalls

  • Label leakage — joining features computed after the label time inflates offline metrics and collapses in production; always as-of join.
  • Train/serve skew — separate offline and online implementations drift; share one definition.
  • Stale online features — model serves on old values; set and monitor freshness.
  • Non-reproducible backfills — inconsistent training history; make feature recomputation idempotent.
  • No entity/timestamp keys — features can't be joined correctly across time; require both.
  • Unversioned features — silent redefinition breaks model comparability; version feature definitions.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

Unknown-333/authoring-airflow-dags

Write production-grade Apache Airflow DAGs using the TaskFlow API — idempotent tasks, correct scheduling and catchup, retries/SLAs, connections/variables, and avoiding top-level code. Use when creating or reviewing Airflow DAGs, scheduling pipelines, wiring task dependencies, configuring retries/backfills, or fixing non-idempotent tasks.

Unknown-333/building-dagster-assets

Build Dagster pipelines using software-defined assets — asset dependencies, partitions, resources and IO managers, asset checks, and schedules/sensors. Use when creating Dagster assets or jobs, modeling data as assets, adding partitions or backfills, wiring resources/IO managers, or migrating from task-based orchestration to assets.

Unknown-333/building-dbt-models

Build well-structured dbt models — staging/intermediate/marts layers, ref() and source(), materializations, and incremental models with the right strategy. Use when creating or refactoring dbt models, choosing table vs view vs incremental, structuring a dbt project, or writing incremental logic.

Unknown-333/building-iceberg-tables

Design and operate Apache Iceberg tables — partitioning and hidden partitioning, partition/schema evolution, snapshots and time travel, compaction and small-file cleanup, and MERGE/upsert for lakehouse tables on Spark, Flink, Trino, or Snowflake. Use when creating or maintaining Iceberg tables, choosing partitioning, evolving schema/partitions, or fixing small-file and metadata bloat.

Unknown-333/building-ingestion-pipelines

Build batch and incremental data ingestion (extract-load) pipelines — full vs incremental extraction, change data capture (CDC), watermarks and high-water marks, API pagination and rate limits, and choosing managed EL tools (Fivetran, Airbyte) vs custom code. Use when ingesting data from databases, APIs, files, or SaaS into a warehouse/lake, or designing incremental extraction and CDC.

Unknown-333/building-kafka-consumers

Build reliable Apache Kafka consumers and producers — consumer groups and partition assignment, offset commit strategy, at-least-once vs exactly-once, idempotent/transactional producers, rebalancing, and dead-letter handling. Use when writing Kafka consumers/producers, configuring offset commits or consumer groups, tuning throughput, or handling rebalances and poison messages.

Unknown-333/debugging-data-pipelines

Systematically root-cause data pipeline failures and data incidents — job errors, wrong or missing data, duplicates, and freshness misses — by tracing lineage upstream, isolating the failing stage, reconciling against source, and planning a safe fix and backfill. Use when a pipeline fails, numbers look wrong, data is missing or duplicated, a dashboard is stale, or a stakeholder reports a data discrepancy.

Unknown-333/designing-backfills-and-replays

Plan and run safe data backfills and replays — idempotent reprocessing of historical windows, partition-by-partition execution, isolating backfill compute from production, verifying results, and avoiding double-counting or changed history. Use when backfilling a new or fixed model, reprocessing after a bug, replaying events, or loading history for a new pipeline without corrupting existing data.

Unknown-333/designing-data-contracts

Define and enforce data contracts between producers and consumers — explicit schema, semantics, ownership, SLAs, and versioning — to prevent silent upstream changes from breaking downstream pipelines. Use when a producer schema change could break consumers, defining an interface between teams/services and the warehouse, or adding schema enforcement at ingestion.

相关技能