This release is a pre-release and may not be stable for production use.
wedata3-feature-engineering
WeData 3.0 特征工程与 Feature Store 客户端 SDK,封装 Feast 0.49 并对接 WeData 平台(Tclake、腾讯云 SDK、MLflow)。
PyPI 包名:
wedata3-feature-engineeringPython 入口:import wedata
功能特性
- Feature Store 客户端:基于 Feast 的特征注册、查询、在线 / 离线特征获取(Redis / Postgres 后端)
- 特征工程客户端:训练集构造、特征关联(feature lookup)、特征表管理
- MLflow 集成:以
wedata.feature_store.mlflow_model/wedata.feature_engineering.mlflow_model形式将特征查询逻辑随模型一起持久化,预测时自动取在线特征 - Spark 支持:内置 Spark Client,离线特征通过 PySpark 处理
- 腾讯云生态:通过
tencentcloud-sdk-python与 Tclake、CAM 等平台能力集成
目录结构
feature-engineering/
├── README.md # 本文件
├── setup.py # 打包配置
├── build.sh # 本地构建 + 上传 PyPI 脚本
├── requirements.txt # 运行依赖
├── test_valid.py # 冒烟测试入口
├── tests/ # 单元测试
└── wedata/ # 主包(顶层 import 名)
├── __init__.py # 暴露版本号
├── feature_store/ # Feature Store 客户端(与 MLflow 集成)
│ ├── client.py
│ ├── mlflow_model.py
│ ├── feature_table_client/
│ └── training_set_client/
├── feature_engineering/ # 特征工程客户端(封装 Feast)
│ ├── client.py
│ ├── mlflow_model.py
│ ├── feast/
│ ├── ml_training_client/
│ └── table_client/
└── common/ # 公共能力
├── base_table_client/ # 表客户端基类
├── cloud_sdk_client/ # 腾讯云 SDK 封装
├── feast_client/ # Feast 适配
├── spark_client/ # Spark / PySpark 封装
├── entities/ # 领域实体
├── constants/ # 常量
├── protos/ # protobuf 定义
├── log/ # 日志
└── utils/ # 工具函数
环境要求
- Python:>= 3.10
- PySpark:3.5.0(与
py4j==0.10.9.7配合) - Feast:0.49.0(
extras=[redis,postgres]) - MLflow:根据使用场景二选一
mlflow2extra:mlflow==2.17.2(WeData 2.0)mlflow3extra:mlflow>=3.10.0,<3.11.0(WeData 3.0)
安装
# 仅运行时,使用 MLflow 3.x(WeData 3.0 默认)
pip install "wedata3-feature-engineering[mlflow3]"
# WeData 2.0 场景
pip install "wedata3-feature-engineering[mlflow2]"
# 开发依赖(flake8 / pytest / python-dotenv)
pip install "wedata3-feature-engineering[dev]"
快速使用
# 特征工程:构造训练集
from wedata.feature_engineering.client import FeatureEngineeringClient
fe_client = FeatureEngineeringClient()
training_set = fe_client.create_training_set(
df=labels_df,
feature_lookups=[...],
label="label",
)
# Feature Store:在线特征查询
from wedata.feature_store.client import FeatureStoreClient
fs_client = FeatureStoreClient()
features = fs_client.get_online_features(
feature_refs=["user_features:age", "user_features:city"],
entity_rows=[{"user_id": "u_001"}],
)
构建与发布
# 本地打包并上传 PyPI(需要在 ~/.pypirc 配置好凭据)
bash build.sh
build.sh 会:
- 清理旧的
dist//build//*.egg-info/ - 读取
wedata/__init__.py中的__version__ - 安装
build/twine python3 -m build生成 wheel + sdisttwine upload推送到 PyPI 镜像
与本仓库其他子项目的关系
| 项目 | 关系 |
|---|---|
../feast-server/ |
本 SDK 默认通过 Feast 的 RemoteRegistry 访问 feast-server 的 gRPC 接口,作为特征注册表 |
../mlflow-server/ |
mlflow_model.py 序列化的特征逻辑可被 MLflow Server 加载与下发 |
../wedata-ml-runtime/ |
Notebook Kernel 启动时会注入 Feast / MLflow 的网关代理与租户隔离逻辑,本 SDK 在其上层使用 |
许可证
Apache License 2.0
Metadata
Release files for wedata3-feature-engineering 0.2.5.dev4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wedata3_feature_engineering-0.2.5.dev4-py3-none-any.whl | Python 3 | none | any | Details for wedata3_feature_engineering-0.2.5.dev4-py3-none-any.whl |
Release files / wedata3_feature_engineering-0.2.5.dev4-py3-none-any.whl
| Download URL | wedata3_feature_engineering-0.2.5.dev4-py3-none-any.whl |
|---|---|
| Size | 208.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a805e2bce032c0d3841d05a3c83936302eeaebed3cc1ba51980bb53a3453fb5a
|
|
BLAKE2b-256 checksum How to use checksums |
9760e3996f2b73f538757691393a76aa57e32cc197ea63760aaf1d40339d4785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for wedata3-feature-engineering 0.2.5.dev4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.