0Pricing
MLOps Academy · บทเรียน

แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน

ส่งคำขอบางส่วนไปยังโมเดลผู้ท้าชิง

แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน เป็นบทเรียน MLOps Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 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. 🎯

คำถามที่พบบ่อย

บทเรียน “แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส MLOps Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน”

ส่งคำขอบางส่วนไปยังโมเดลผู้ท้าชิง คุณปฏิบัติ MLOps Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน MLOps Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน MLOps Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน

บทเรียน “แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน MLOps Academy นี้ได้ไหม

ได้ บทเรียน MLOps Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. แบ่งทราฟฟิกระหว่างโมเดลต่างเวอร์ชัน
  2. เลือกเมตริกที่สำคัญ
  3. อ่านนัยสำคัญโดยไม่หลอกตัวเอง
  4. เลื่อนโมเดลที่ชนะหรือย้อนกลับ
← กลับไปที่ MLOps Academy