DVCのステージでパイプラインを定義する
依存関係を指定し、dvc.yamlでステップをつなぎます。
「DVCのステージでパイプラインを定義する」はCoddyKit上の無料MLOps Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはMLOps Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 MLOps Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Meet dvc.yaml
DVC describes your whole pipeline in one file called dvc.yaml. It lists each stage, the command it runs, and what it depends on. 📄
Add a Stage with dvc stage add
You rarely hand-write the file. The dvc stage add command builds a stage entry for you from flags you pass on the command line.
dvc stage add -n prep \
-d data/raw.parquet -o data/prepared \
python prep.pyThe -d Flag Means Dependency
The -d flag declares a dependency: a file or script the stage reads. DVC watches these to know when the stage needs to re-run.
The -o Flag Means Output
The -o flag declares an output the stage produces. DVC tracks these files so later stages can depend on them in turn.
Wiring Stages Together
You connect stages by making one stage's output the next stage's dependency. That shared file is the link that forms the pipeline graph.
What a Stage Looks Like in YAML
Each stage in dvc.yaml has a cmd plus its deps and outs. This is the readable record of how your model was built.
stages:
prep:
cmd: python prep.py
deps:
- data/raw.parquet
outs:
- data/preparedRun the Pipeline with dvc repro
The dvc repro command executes the pipeline in dependency order, running each stage only if its inputs changed.
dvc reproDVC Builds the DAG for You
From the deps and outs, DVC infers the full DAG automatically. You never specify run order by hand; the graph decides it.
Visualize It with dvc dag
Run dvc dag to print the pipeline as a graph in your terminal. It is a quick way to confirm stages are wired the way you expect.
dvc dagdvc.lock Records What Ran
After a run, DVC writes dvc.lock with the exact hashes of every input and output. Commit it so teammates reproduce the same result.
The Pipeline Lives in Git
dvc.yaml and dvc.lock are plain text, so they live in Git alongside your code. Your whole pipeline becomes versioned and reviewable.
Quick Check
Test your grasp of DVC stage flags.
Recap: Pipelines in dvc.yaml
You wired stages with deps and outs in dvc.yaml, then ran the graph with dvc repro. DVC tracks order and results for you. 🔗
よくある質問
「DVCのステージでパイプラインを定義する」レッスンは無料ですか?
はい。「DVCのステージでパイプラインを定義する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、MLOps Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 MLOps Academyコースには全4レッスンが含まれています。
「DVCのステージでパイプラインを定義する」で何を学びますか?
依存関係を指定し、dvc.yamlでステップをつなぎます。 ブラウザで直接実行するハンズオンコードでMLOps Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
MLOps Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのMLOps Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「DVCのステージでパイプラインを定義する」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このMLOps Academyレッスンでコードを書いて実行できますか?
はい。すべてのMLOps Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- ステージ:取り込み、準備、学習、評価
- DVCのステージでパイプラインを定義する
- 変更のないステップをキャッシュしてスキップする
- params.yamlで実行をパラメーター化する