← 返回 Skill 仓库

ml-pipeline-creation

一项用于创建、管理和自动化机器学习流水线的技能。

slug: ml-pipeline-creation 数据与 AI 流程型 2 个文件 · 4.6 KB 更新 2026-10-20 ↓ 1 次下载 💬 1 条反馈 规范度 82/100
登录后下载(1 虾条) 使用反馈(1) 查看 JSON
实测评测 · 复核中
这个 Skill 的首轮评测结果正在复核,通过后会在官方榜公布分数。它属于流程型 Skill,需要多轮交互与工具调用才能发挥作用,单轮结论会低估它的价值。了解评测方法 →
社区实测 用户用自己的 API Key 跑的结果,模型与环境各不相同,仅供横向参考 登录后用我的 API 测 →
还没有人跑过。装上你自己的 Key,用你日常用的模型测一遍——结果只出现在你的记录里,不进官方榜。
5.0
★★★★★
1 人评分 · 综合热度 32.8

一行命令安装

下载这个 Skill 需要先登录(免费注册,只需用户名和密码)。去登录 →

使用反馈 · 1

登录后可以发表使用反馈。去登录 →
鱼
鱼板本板

实测过后的确实不一样,这才是真正的skill

规范度体检 · 82/100

按元信息、示例、可执行性、完整性等 13 项自动检查,供作者自查改进;不影响用户评分。

SKILL.md 内容

## Workflow

This skill enables the creation and management of machine learning (ML) pipelines, automating the process of training, evaluating, and deploying ML models. The workflow is designed to be flexible and adaptable to various ML tasks and frameworks.

1.  **Define Pipeline Structure**: The user specifies the stages of the ML pipeline, including data preprocessing, model training, model evaluation, and deployment. This is typically done in a configuration file (e.g., YAML or JSON).
2.  **Component Implementation**: Each stage of the pipeline is implemented as a separate component. These components are reusable and can be chained together to form a complete pipeline.
3.  **Pipeline Execution**: The skill executes the pipeline, running each component in the specified order. It handles data flow between components and manages dependencies.
4.  **Monitoring and Logging**: The skill provides tools for monitoring the pipeline's execution, logging results, and tracking experiments.
5.  **Deployment**: Once a model is trained and evaluated, the skill can automate its deployment to a serving environment.

## Usage

To use this skill, you need to provide a pipeline definition file and the implementation of the pipeline components.

### Example: Simple Scikit-learn Pipeline

Here's an example of how to define and run a simple ML pipeline using this skill.

**`pipeline.yaml`**

```yaml
name: simple-sklearn-pipeline
components:
  - name: data-preprocessing
    script: preprocess.py
    inputs:
      - raw_data: /path/to/raw_data.csv
    outputs:
      - processed_data: /path/to/processed_data.csv
  - name: train-model
    script: train.py
    inputs:
      - processed_data: /path/to/processed_data.csv
    outputs:
      - model: /path/to/model.pkl
  - name: evaluate-model
    script: evaluate.py
    inputs:
      - model: /path/to/model.pkl
      - test_data: /path/to/test_data.csv
    outputs:
      - metrics: /path/to/metrics.json
```

**`preprocess.py`**

```python
import pandas as pd
from sklearn.model_selection import train_test_split

# Load data
df = pd.read_csv('/path/to/raw_data.csv')

# Simple preprocessing
X = df.drop('target', axis=1)
y = df['target']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Save processed data
pd.concat([X_train, y_train], axis=1).to_csv('/path/to/processed_data.csv', index=False)
pd.concat([X_test, y_test], axis=1).to_csv('/path/to/test_data.csv', index=False)
```

**`train.py`**

```python
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
import joblib

# Load processed data
df = pd.read_csv('/path/to/processed_data.csv')
X_train = df.drop('target', axis=1)
y_train = df['target']

# Train model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)

# Save model
joblib.dump(model, '/path/to/model.pkl')
```

**`evaluate.py`**

```python
import pandas as pd
import joblib
import json
from sklearn.metrics import accuracy_score

# Load model and test data
model = joblib.load('/path/to/model.pkl')
df = pd.read_csv('/path/to/test_data.csv')
X_test = df.drop('target', axis=1)
y_test = df['target']

# Evaluate model
y_pred = model.predict(X_test)
accuracy = accuracy_score(y_test, y_pred)

# Save metrics
with open('/path/to/metrics.json', 'w') as f:
    json.dump({'accuracy': accuracy}, f)

print(f'Model accuracy: {accuracy}')
```