0Pricing
Data Science Academy · บทเรียน

เลือกตัวชี้วัดสำหรับเหตุการณ์ที่พบได้น้อย

ใช้เส้นโค้ง PR แทนความแม่นยำทั่วไป

เลือกตัวชี้วัดสำหรับเหตุการณ์ที่พบได้น้อย เป็นบทเรียน Data Science Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Data Science Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Data Science Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Choose the Right Yardstick

You already distrust accuracy on imbalance. Now you need metrics that actually reward catching the rare event.

Precision Asks Are We Sure

Precision is the share of flagged positives that are truly positive. High precision means few false alarms among your alerts.

Recall Asks Did We Catch It

Recall is the share of real positives you actually caught. For rare, costly events, missing them is the worst outcome.

F1 Balances Both

The F1 score blends precision and recall into one number. It rises only when both are decent, punishing a lopsided model.

The PR Curve

A precision-recall curve traces the trade-off across every threshold. It speaks directly to the rare class you care about.

Why PR Over ROC Here

On heavy imbalance, ROC curves can look rosy because true negatives are plentiful. The PR curve stays honest about the rare class.

Average Precision

Average precision summarizes the PR curve in a single score. A higher value means strong precision held across many recall levels.

Read the Full Report

One scikit-learn call prints precision, recall, and F1 for every class at once, so the minority is never hidden.

from sklearn.metrics import classification_report
print(classification_report(y_test, preds))

Watch the Minority Row

In that report, fix your eyes on the rare class row. Its recall and precision tell you whether the model truly works. 🎯

Match Metric to Cost

If missed cases are dangerous, optimize recall. If false alarms are expensive, favor precision. Let the real-world cost decide.

Report More Than One

Never lean on a single number. Show precision, recall, F1, and a PR curve together so nobody is fooled by inflated accuracy.

Quick Check

Which metric best suits rare, important events?

Recap

For rare events, judge with precision, recall, F1, and PR curves, not accuracy. Match the metric to which mistake costs you most. 🎯

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

บทเรียน “เลือกตัวชี้วัดสำหรับเหตุการณ์ที่พบได้น้อย” ฟรีหรือไม่

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

คุณจะเรียนรู้อะไรในบทเรียน “เลือกตัวชี้วัดสำหรับเหตุการณ์ที่พบได้น้อย”

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

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

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

บทเรียน “เลือกตัวชี้วัดสำหรับเหตุการณ์ที่พบได้น้อย” ใช้เวลานานแค่ไหน

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

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

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

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

  1. เหตุใดความแม่นยำจึงหลอกเราเมื่อข้อมูลไม่สมดุล
  2. การสุ่มตัวอย่างใหม่: SMOTE และการลดตัวอย่าง
  3. น้ำหนักคลาสและค่าเกณฑ์
  4. เลือกตัวชี้วัดสำหรับเหตุการณ์ที่พบได้น้อย
← กลับไปที่ Data Science Academy