Definire una pipeline con gli stadi DVC
Colleghi i passaggi in dvc.yaml con le relative dipendenze.
Definire una pipeline con gli stadi DVC è una lezione MLOps Academy gratuita su CoddyKit. Questa è la lezione 2 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento MLOps Academy, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso MLOps Academy include 4 lezioni in totale.
Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.
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. 🔗
Domande Frequenti
La lezione «Definire una pipeline con gli stadi DVC» è gratuita?
Sì — il testo completo di «Definire una pipeline con gli stadi DVC» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso MLOps Academy, passa a CoddyKit PRO. Il corso MLOps Academy include 4 lezioni in totale.
Cosa imparerò in «Definire una pipeline con gli stadi DVC»?
Colleghi i passaggi in dvc.yaml con le relative dipendenze. Eserciti MLOps Academy con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.
Ho bisogno di esperienza per iniziare MLOps Academy?
Non è richiesta alcuna esperienza precedente. MLOps Academy su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 2 di 4.
Quanto tempo richiede la lezione «Definire una pipeline con gli stadi DVC»?
La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.
Posso scrivere ed eseguire codice in questa lezione MLOps Academy?
Sì. Ogni lezione MLOps Academy include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.
Tutte le lezioni di questo corso
- Stadi: Ingest, Prep, Train, Eval
- Definire una pipeline con gli stadi DVC
- Memorizzare nella cache e saltare i passaggi invariati
- Parametrizzare le esecuzioni con params.yaml