Merges von der Modellqualität abhängig machen
Blockieren Sie einen PR, wenn das neue Modell schlechter abschneidet.
Merges von der Modellqualität abhängig machen ist eine kostenlose MLOps Academy-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des MLOps Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
A Gate at the Merge
A quality gate blocks a pull request from merging unless the new model is good enough. It turns model quality into a hard rule, not a hope. 🚧
Why Code Tests Are Not Enough
Code can pass every test and still produce a worse model. You need a separate check on the metric, like accuracy or F1, to protect users.
Pick One Guarding Metric
Choose a single primary metric that reflects success for your task. Gating on too many numbers at once makes every PR a confusing negotiation.
Set a Clear Threshold
Define a minimum bar, your threshold. If the new model scores below it, the build fails and the merge is blocked automatically.
MIN_ACCURACY = 0.85Evaluate on a Fixed Set
Always score against the same held-out test set. A frozen evaluation set makes comparisons fair across every pull request and run.
Fail the Build on Purpose
In CI, a step that exits with a non-zero code marks the job failed. So if the metric misses, you deliberately raise an error to stop the merge.
if acc < MIN_ACCURACY:
raise SystemExit(f"acc {acc} below bar")Compare to the Champion
A smarter gate compares the new model to the current baseline in production, blocking merges that regress instead of just hitting a fixed number.
assert new_acc >= baseline_accBranch Protection Enforces It
In GitHub, mark the CI job a required check under branch protection. Then the merge button stays disabled until your gate passes.
Surface the Number in the PR
Print the score so reviewers see it. A clear log line or PR comment showing the metric turns a red X into an explanation people trust.
print(f"::notice::accuracy={acc:.3f}")Allow a Reviewed Override
Sometimes a small dip is fine. Let a human override a failed gate through review approval, so the rule guides without fully blocking the team.
Guard Against Flaky Scores
Set a seed and a stable test set so the same model gives the same number. A deterministic eval keeps the gate from failing on pure luck.
Quick Check
How does a CI step actually block a merge when the model is too weak?
Recap
Pick one metric, set a threshold or beat the baseline, and fail the build when it misses. Mark the job required so a weak model can never merge silently.
Häufig gestellte Fragen
Ist die Lektion „Merges von der Modellqualität abhängig machen“ kostenlos?
Ja — der vollständige Text von „Merges von der Modellqualität abhängig machen“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des MLOps Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Merges von der Modellqualität abhängig machen“?
Blockieren Sie einen PR, wenn das neue Modell schlechter abschneidet. Du übst MLOps Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um MLOps Academy zu starten?
Keine Vorkenntnisse erforderlich. MLOps Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.
Wie lange dauert die Lektion „Merges von der Modellqualität abhängig machen“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser MLOps Academy-Lektion Code schreiben und ausführen?
Ja. Jede MLOps Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Was CI/CD für Modelle bedeutet
- Ein GitHub-Actions-Workflow für ML
- Merges von der Modellqualität abhängig machen
- Das Image beim Release bauen und übertragen