ترقية أفضل نموذج إلى Production
اختر النموذج الفائز وجهّزه للتقديم.
ترقية أفضل نموذج إلى Production درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MLOps Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MLOps Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
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. ✅
الأسئلة الشائعة
هل درس «ترقية أفضل نموذج إلى Production» مجاني؟
نعم — نص درس «ترقية أفضل نموذج إلى Production» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.
ماذا ستتعلم في «ترقية أفضل نموذج إلى Production»؟
اختر النموذج الفائز وجهّزه للتقديم. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟
لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «ترقية أفضل نموذج إلى Production»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟
نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- التدريب والتسجيل في السجل
- ترقية أفضل نموذج إلى Production
- تقديم نموذج Production
- تتبّع دورة التنبؤ الكاملة