Promueva el mejor modelo a Production
Elija el ganador y déjelo preparado para servir predicciones.
Promueva el mejor modelo a Production es una lección gratuita de MLOps Academy en CoddyKit. Esta es la lección 2 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de MLOps Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de MLOps Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
Pick a Winner
You now have several registered versions. Promotion is choosing which one your service should actually use, then marking it as Production. 🏆
List the Versions
Use the MlflowClient to fetch every version of a model so you can compare them before choosing.
from mlflow import MlflowClient
client = MlflowClient()
versions = client.search_model_versions("name='churn-classifier'")Compare by Metric
Each version links back to its run, so you can read that run's accuracy and pick the highest scorer programmatically.
for v in versions:
run = client.get_run(v.run_id)
print(v.version, run.data.metrics["accuracy"])Aliases Over Stages
Newer MLflow uses named aliases like champion instead of fixed stages. An alias is a movable pointer to one chosen version.
Set the Champion Alias
Point the champion alias at your best version. Your serving code can then always ask for champion and get the current pick.
client.set_registered_model_alias(
name="churn-classifier",
alias="champion",
version="3",
)Stages Still Work
On older setups you transition a version to the Production stage instead. The idea is the same: mark which one is live.
client.transition_model_version_stage(
name="churn-classifier",
version=3,
stage="Production",
)Archive the Old One
When you promote a new version, move the previous live one aside. With stages that means Archived; with aliases you simply reassign the pointer.
Tag the Decision
Add a tag recording why this version won. Future teammates will thank you for the breadcrumb when they audit the choice.
client.set_model_version_tag(
"churn-classifier", "3",
"approved_by", "data-team",
)Promotion Is Reversible
Because old versions are kept, you can re-point champion back to a previous version instantly if the new one misbehaves. 🔁
Quick Check
What is the main advantage of a model alias like champion?
Serving Stays Decoupled
The big win: your API never names version 3. It asks for the champion, so promotion is a registry change, not a code deploy.
Promote With Confidence
Compare, then promote only what beats the current pick. Tying promotion to metrics keeps weak models out of production.
Recap: Choosing the Live Model
You listed versions, compared metrics, set the champion alias, tagged the reason, and kept the choice reversible. That is safe promotion. ✅
Preguntas frecuentes
¿La lección «Promueva el mejor modelo a Production» es gratis?
Sí — el texto completo de «Promueva el mejor modelo a Production» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de MLOps Academy, actualiza a CoddyKit PRO. El curso de MLOps Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Promueva el mejor modelo a Production»?
Elija el ganador y déjelo preparado para servir predicciones. Practicas MLOps Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar MLOps Academy?
No se requiere experiencia previa. MLOps Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 2 de 4.
¿Cuánto tiempo toma la lección «Promueva el mejor modelo a Production»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de MLOps Academy?
Sí. Cada lección de MLOps Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Entrene y registre el modelo
- Promueva el mejor modelo a Production
- Sirva el modelo de Production
- Trace el recorrido completo de una predicción