dvc
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "dvc":https://skillpi.com/zh/skills/deepskill-9908e6cd5b05bb328e2f01e604f88a008905d66297ffe1df4b7796a6e0eb31e9。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于机器学习项目的数据版本控制。与 Git 一起跟踪大型数据集和模型,构建可复现的机器学习流水线,并通过指标比较运行实验。支持包括 S3、GCS、Azure 和本地文件系统等任意存储后端。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: dvc
description: |
Data Version Control for ML projects. Track large datasets and models alongside Git,
build reproducible ML pipelines, and run experiments with metric comparison. Works with
any storage backend including S3, GCS, Azure, and local filesystems.
license: Apache-2.0
compatibility: 'python 3.8+, dvc 3.0+, Linux/macOS/Windows'
metadata:
author: terminal-skills
version: 1.0.0
category: data-ai
tags:
- data-versioning
- ml-pipelines
- experiment-tracking
- reproducibility
- gitDVC (Data Version Control)
Installation
# Install DVC with cloud storage support
pip install dvc[s3] # For AWS S3
pip install dvc[gs] # For Google Cloud Storage
pip install dvc[azure] # For Azure Blob Storage
pip install dvc[all] # All remotes
# Initialize DVC in a Git repo
cd my-ml-project
git init
dvc init
Track Data Files
# track_data.sh — Add large files to DVC tracking instead of Git
# Add a large dataset
dvc add data/training_images/
dvc add data/dataset.csv
# DVC creates .dvc files (small pointers) — commit those to Git
git add data/training_images.dvc data/dataset.csv.dvc .gitignore
git commit -m "Track training data with DVC"
Configure Remote Storage
# setup_remote.sh — Configure where DVC stores actual file contents
# S3
dvc remote add -d myremote s3://my-bucket/dvc-storage
# Google Cloud Storage
dvc remote add -d myremote gs://my-bucket/dvc-storage
# Local / network path
dvc remote add -d myremote /mnt/shared/dvc-storage
# Push data to remote
dvc push
# Pull data from remote (on another machine or after cloning)
dvc pull
Build Reproducible Pipelines
# dvc.yaml — Define ML pipeline stages with dependencies and outputs
stages:
prepare:
cmd: python src/prepare.py
deps:
- src/prepare.py
- data/raw/
outs:
- data/processed/
train:
cmd: python src/train.py
deps:
- src/train.py
- data/processed/
params:
- train.epochs
- train.learning_rate
- train.batch_size
outs:
- models/model.pkl
metrics:
- metrics/train.json:
cache: false
evaluate:
cmd: python src/evaluate.py
deps:
- src/evaluate.py
- models/model.pkl
- data/processed/
metrics:
- metrics/eval.json:
cache: false
plots:
- metrics/confusion_matrix.csv:
x: predicted
y: actual
# params.yaml — Pipeline parameters (tracked by DVC)
train:
epochs: 50
learning_rate: 0.001
batch_size: 32
# Run the entire pipeline (only re-runs changed stages)
dvc repro
# Run a specific stage
dvc repro train
Experiment Tracking
# experiments.sh — Run and compare ML experiments
# Run an experiment with modified parameters
dvc exp run --set-param train.learning_rate=0.01
# Run multiple experiments in parallel
dvc exp run --set-param train.learning_rate=0.001 --queue
dvc exp run --set-param train.learning_rate=0.01 --queue
dvc exp run --set-param train.learning_rate=0.1 --queue
dvc queue start --jobs 3
# Compare experiments
dvc exp show
dvc exp diff
# Apply a successful experiment to workspace
dvc exp apply exp-abc123
# Push experiment to Git branch
dvc exp push origin exp-abc123
Metrics and Plots
# train.py — Training script that outputs DVC-tracked metrics
import json
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score
import yaml
import pickle
# Load params
with open("params.yaml") as f:
params = yaml.safe_load(f)["train"]
X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
model = RandomForestClassifier(n_estimators=params["epochs"])
model.fit(X_train, y_train)
preds = model.predict(X_test)
metrics = {
"accuracy": accuracy_score(y_test, preds),
"f1_score": f1_score(y_test, preds, average="weighted"),
}
with open("metrics/train.json", "w") as f:
json.dump(metrics, f, indent=2)
with open("models/model.pkl", "wb") as f:
pickle.dump(model, f)
# View metrics across experiments
dvc metrics show
dvc metrics diff
# Generate plots
dvc plots show metrics/confusion_matrix.csv
dvc plots diff # Compare plots between experiments
Data Access Without Cloning
# Access tracked files from any DVC repo without full clone
dvc get https://github.com/org/ml-repo data/processed/dataset.csv
dvc import https://github.com/org/ml-repo models/model.pkl
# dvc_api.py — Access DVC-tracked files programmatically
import dvc.api
# Read a file from a DVC repo
with dvc.api.open("data/dataset.csv", repo="https://github.com/org/ml-repo") as f:
import pandas as pd
df = pd.read_csv(f)
# Get the URL of a tracked file
url = dvc.api.get_url("models/model.pkl", repo="https://github.com/org/ml-repo")
Key Concepts
.dvcfiles: Small pointer files committed to Git that reference large data in remote storagedvc repro: Reproduce pipelines — only re-runs stages with changed dependencies- Experiments: Branch-free experiment tracking — run, compare, and apply results
- Params: YAML parameter files tracked by DVC for reproducible configurations
- Metrics: JSON/YAML metrics files with built-in comparison tools
- Remote storage: S3, GCS, Azure, SSH, HDFS — data stays where you want it
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供机器学习项目中数据版本控制、流水线构建和实验跟踪等高价值功能
- 解决 ML 工程中的核心痛点:数据版本化、可复现性、实验管理
亮点
- description 清晰覆盖 DVC 的核心用途和使用场景
- 触发词精准,边界清晰,无歧义
待提升项
-
缺少 When to Use 显式章节 原报告严重程度:轻微
文档结构完整但未设置显式的 When to Use 章节
改进建议:建议添加 When to Use 章节以明确适用场景
亮点
- 文档结构清晰,涵盖安装、配置、流水线、实验等完整流程
- 每个功能模块均配有具体命令和端到端示例
亮点
- 所有命令均为标准 DVC 官方用法,参数正确
- 工具来源明确,覆盖主要使用场景,无执行风险
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
保存或修改文件
先确认输出目录和同名文件是否会被覆盖;重要文件保留备份,优先写入新的输出目录。
主文档提及 · 第 182, 185 行 -
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 27, 28, 29, 30 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- github.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。