MLOps Pipeline Data Pipeline ETL — สร้างระบบ ML

MLOps Pipeline คืออะไรและต่างจาก Data Pipeline อย่างไร

MLOps (Machine Learning Operations) เป็นแนวปฏิบัติที่รวม ML, DevOps และ Data Engineering เข้าด้วยกัน เป้าหมายคือทำให้ ML models ถูก deploy, monitor และ maintain ใน production ได้อย่างมีประสิทธิภาพ MLOps Pipeline ครอบคลุมตั้งแต่ data ingestion, feature engineering, model training, evaluation, deployment จนถึง monitoring
Data Pipeline (ETL/ELT) โฟกัสที่การ Extract ข้อมูลจาก sources, Transform ให้อยู่ในรูปแบบที่ต้องการ และ Load เข้า destination เช่น data warehouse ส่วน MLOps Pipeline มี components เพิ่มเติมคือ Feature Store สำหรับเก็บ features ที่พร้อมใช้, Training Pipeline สำหรับ train models, Model Registry สำหรับ version control models, Serving Infrastructure สำหรับ inference และ Monitoring สำหรับตรวจจับ data drift และ model degradation
ทั้งสอง pipeline ทำงานร่วมกัน Data Pipeline เตรียมข้อมูลให้ MLOps Pipeline ใช้ train models ข้อมูลที่ผ่าน ETL จะถูกส่งไป Feature Store แล้ว Training Pipeline ดึง features มา train ผลลัพธ์คือ model ที่ถูก deploy ผ่าน Serving Pipeline
เครื่องมือที่นิยมใช้ใน MLOps ได้แก่ Apache Airflow สำหรับ orchestration, MLflow สำหรับ experiment tracking, DVC สำหรับ data versioning, Feast สำหรับ Feature Store, Seldon/BentoML สำหรับ model serving และ Evidently/WhyLabs สำหรับ monitoring
เนื้อหาเกี่ยวข้อง — ดูเพิ่มเติมเรื่อง เหรียญ Pi ราคา — คู่มือฉบับสมบูรณ์ 2026
ออกแบบ End-to-End MLOps Architecture
สถาปัตยกรรม MLOps Pipeline แบบครบวงจร
# MLOps Pipeline Architecture
#
# === Data Layer ===
# Sources -> Ingestion -> Raw Storage -> ETL -> Feature Store
#
# [Databases] ──┐
# [APIs] ──┤──> [Airflow ETL] ──> [S3/GCS Raw] ──> [Feature Engineering]
# [Streams] ──┤ |
# [Files] ──┘ v
# [Feast Feature Store]
# |
# === Training Layer === v
# [Training Pipeline]
# [Feature Store] ──> [Data Validation] ──> [Training] ──> [Evaluation]
# | | |
# [Great Expectations] [MLflow] [Metrics Check]
# |
# Pass?─────┤
# / \
# Yes No
# | |
# === Deployment Layer === v v
# [Model Registry] [Alert Team]
# |
# [Staging Deploy]
# |
# [A/B Testing]
# |
# [Production Deploy]
# |
# === Monitoring Layer === v
# [Model Serving]
# |
# ┌───────────┤───────────┐
# v v v
# [Data Drift] [Model Perf] [System Metrics]
# | | |
# └───────────┤───────────┘
# v
# [Alert/Retrain]
#
# === Tools Stack ===
# Orchestration: Apache Airflow
# ETL: Spark / dbt / Pandas
# Feature Store: Feast
# Experiment Tracking: MLflow
# Data Versioning: DVC
# Model Registry: MLflow Model Registry
# Serving: BentoML / Seldon Core
# Monitoring: Evidently AI
# CI/CD: GitHub Actions
# Infrastructure: Kubernetes / Docker
สร้าง Feature Engineering Pipeline ด้วย Python
โค้ดสำหรับ feature engineering pipeline
แนะนำเพิ่มเติม — อีบุ๊กการลงทุน SiamCafeBook
Training Pipeline และ Experiment Tracking

Pipeline สำหรับ train models พร้อม MLflow tracking
Model Serving และ Monitoring Pipeline
Deploy model สำหรับ inference และ monitoring
เนื้อหาเกี่ยวข้อง — ดูเพิ่มเติมเรื่อง Text Generation WebUI Performance Tuning
Orchestrate ทั้งหมดด้วย Airflow
Airflow DAG สำหรับ orchestrate MLOps pipeline
FAQ คำถามที่พบบ่อย
Q: MLOps กับ DataOps ต่างกันอย่างไร?
A: DataOps โฟกัสที่การจัดการ data pipelines ให้มีคุณภาพ เร็ว และ reliable ครอบคลุม data ingestion, transformation, quality, governance ส่วน MLOps โฟกัสที่ ML model lifecycle ตั้งแต่ training จนถึง production monitoring ทั้งสองทำงานร่วมกัน DataOps เตรียมข้อมูลให้ MLOps ใช้
แนะนำเพิ่มเติม — ติดตาม XM Signal
เนื้อหาเกี่ยวข้อง — อ่านต่อ: Drone CI ระบบ CI/CD Container Native
Q: Feature Store จำเป็นไหม?
A: สำหรับทีมเล็กที่มี models ไม่กี่ตัวอาจไม่จำเป็น แต่เมื่อทีมโตขึ้นและมี models หลายตัวที่ใช้ features ร่วมกัน Feature Store ช่วยลด duplication ของ feature computation, ทำให้ online/offline features consistent และเป็น single source of truth สำหรับ features ที่ทุก model ใช้ร่วมกัน
Q: ควรใช้ MLflow หรือ Weights and Biases?
A: MLflow เป็น open source ติดตั้งเอง ฟรี มี Model Registry ในตัว เหมาะสำหรับทีมที่ต้องการ control เต็มที่ W&B เป็น cloud service ที่ UI ดีกว่า collaboration features ดีกว่า แต่มีค่าใช้จ่าย สำหรับ startup แนะนำเริ่มจาก MLflow แล้วเปลี่ยนเมื่อ scale ถ้าต้องการ
เนื้อหาเกี่ยวข้อง — บทความที่เกี่ยวข้อง: regularization machine learning คือ —
Q: Model monitoring ต้องดูอะไรบ้าง?
A: ต้อง monitor 4 ด้าน คือ Data Drift (input features เปลี่ยนจาก training data ไหม), Concept Drift (ความสัมพันธ์ระหว่าง features กับ target เปลี่ยนไหม), Model Performance (accuracy, F1, AUC ลดลงไหม) และ System Metrics (latency, throughput, error rate) ถ้าตรวจพบ drift ควร trigger retrain pipeline อัตโนมัติ





