Uzależnianie scalania od jakości modelu
Zablokuj PR, jeśli nowy model uzyska gorszy wynik
Uzależnianie scalania od jakości modelu to bezpłatna lekcja MLOps Academy na CoddyKit. To lekcja 3 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej MLOps Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs MLOps Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
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.
Często zadawane pytania
Czy lekcja „Uzależnianie scalania od jakości modelu” jest bezpłatna?
Tak — pełny tekst „Uzależnianie scalania od jakości modelu” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu MLOps Academy, przejdź na CoddyKit PRO. Kurs MLOps Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Uzależnianie scalania od jakości modelu”?
Zablokuj PR, jeśli nowy model uzyska gorszy wynik Ćwiczysz MLOps Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć MLOps Academy?
Nie wymagamy żadnego doświadczenia. MLOps Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 3 z 4.
Ile czasu zajmuje lekcja „Uzależnianie scalania od jakości modelu”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji MLOps Academy?
Tak. Każda lekcja MLOps Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Co CI/CD oznacza dla modeli
- Workflow GitHub Actions dla ML
- Uzależnianie scalania od jakości modelu
- Budowanie i wysyłanie obrazu przy wydaniu