تقسيم حركة المرور بين إصدارات النموذج
وجّه نسبة من الطلبات إلى نموذج منافس.
تقسيم حركة المرور بين إصدارات النموذج درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MLOps Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MLOps Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Two Models, One Live Test
You have a new model you believe is better. Instead of guessing, you let real traffic decide. An A/B test runs both models side by side on live users. 🔬
Champion and Challenger
The current model in production is your champion. The new candidate you want to prove is the challenger. The test sees if the challenger truly beats the champion.
Splitting the Traffic
The core idea is simple: send a slice of requests to each model. A common start is 90/10, keeping most users safe on the champion while the challenger proves itself.
A Tiny Router
A basic split just rolls a random number per request and routes by the cutoff. Here ten percent of traffic reaches the challenger.
import random
def pick_model(challenger_share=0.1):
return "challenger" if random.random() < challenger_share else "champion"Keep Each User Consistent
Random per request flips a user between models on every visit. Instead, hash the user id so the same person always lands on the same model.
Hashing for Sticky Splits
Hashing the user id gives a stable bucket. The same id maps to the same model every time, which keeps the test clean.
import hashlib
def bucket(user_id, challenger_share=0.1):
h = int(hashlib.md5(user_id.encode()).hexdigest(), 16)
return "challenger" if (h % 100) < challenger_share * 100 else "champion"Log Which Model Served
For every prediction, record which model handled it. Without this assignment log, you can never compare the two groups fairly later on. 📝
Start Small, Then Ramp
Begin with a tiny challenger share to limit risk. As confidence grows, you raise the percentage gradually instead of flipping everyone over at once.
Control the Split with Config
Hard-coding the share means a redeploy to change it. Read the split ratio from config so you can dial traffic up or down without shipping code.
Same Inputs, Fair Fight
Both models must see the same kind of requests and the same features. If the groups differ in who they serve, any winner you find may be an illusion.
It Is Just Routing
At its heart, an A/B test is a routing layer plus careful logging. Get the split sticky and recorded, and you have the foundation for a trustworthy comparison. ✅
Quick Check
Let us check how to keep your split clean.
Recap
An A/B test pits a champion against a challenger by splitting live traffic. Hash users for sticky buckets, log every assignment, and start small. 🎯
الأسئلة الشائعة
هل درس «تقسيم حركة المرور بين إصدارات النموذج» مجاني؟
نعم — نص درس «تقسيم حركة المرور بين إصدارات النموذج» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.
ماذا ستتعلم في «تقسيم حركة المرور بين إصدارات النموذج»؟
وجّه نسبة من الطلبات إلى نموذج منافس. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟
لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «تقسيم حركة المرور بين إصدارات النموذج»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟
نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- تقسيم حركة المرور بين إصدارات النموذج
- اختيار المقاييس المهمة
- قراءة الدلالة الإحصائية بموضوعية
- ترقية النموذج الفائز أو التراجع عنه