Thuta Learning
ရှာဖွေရန်
ExercisesData & Databasesintermediate

လက်တွေ့ လေ့ကျင့်ခန်း အစုံ ၁

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • လက်တွေ့ လေ့ကျင့်ခန်း အစုံ ၁ ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် scikit-learn code ကို run ကြည့်တတ်မယ်
  • Real project ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

ဒီ round က learn ခဲ့ပြီးသား Basic/Intermediate concept တွေကို လက်တွေ့ ပြန်စမ်းကြည့်ဖို့ round ပါ — Supervised vs Unsupervised, Regression vs Classification ကို ခွဲသိခြင်း, ML pipeline code ထဲက error ကို ရှာဖွေခြင်း, evaluation metric ကို မှန်ကန်စွာ ရွေးချယ်တတ်ခြင်းကိုပဲ ကိုယ်တိုင် လက်တွေ့ လုပ်ကြည့်ရမှာပါ။ Task တစ်ခုချင်းစီက ၅ မိနစ်ထက် မကြာသင့်ပါဘူး။

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Task 1: 'Supervised Learning', 'Unsupervised Learning', 'Regression', 'Classification' — ၄ လုံးရဲ့ ကွာခြားချက်ကို ဝါကျတစ်ကြောင်းစီနဲ့ ရှင်းပြပါ။ Task 2: `model.fit(X_test, y_test)` ဆိုပြီး (X_train အစား X_test) မှားရေးထားရင် ဘာ ပြဿနာ ဖြစ်နိုင်လဲ ခန့်မှန်းပြီး ရေးပါ။ Task 3: Class imbalance ရှိတဲ့ dataset (95% Class A, 5% Class B) မှာ Accuracy 95% ရလာရင် ဘာကြောင့် suspicious ဖြစ်သင့်လဲ ရှင်းပါ။ Task 4: House price prediction (continuous value) vs email spam detection (category) — ဘယ်ဟာက Regression, ဘယ်ဟာက Classification လဲ ဆုံးဖြတ်ပြီး ဘာကြောင့်လဲ ရေးပါ။

အတူတူ ကြည့်မယ်

text
# Task 2 - training on test data (data leakage)
model.fit(X_test, y_test)  # WRONG! should be X_train, y_train

Result: The model has now "seen" the test data during
training. When you evaluate on X_test again, the score
will look artificially high — you're testing on data the
model already memorized, not on truly unseen data.
This completely defeats the purpose of the train/test split.

# Task 3 - suspicious 95% accuracy
If the dataset is 95% Class A, a model that ALWAYS
predicts "Class A" (ignoring the input entirely) would
still score 95% accuracy — check precision/recall/F1
for Class B before trusting this number.
You should see
Supervised/Unsupervised ကွာခြားချက်၊ data leakage bug ရှာဖွေခြင်း၊ class imbalance awareness ရရှိလာမည်။

၅ မိနစ် စမ်းကြည့်

ကိုယ်ပိုင် ML pipeline code (sample) ရေးပြီး တမင် `X_test`/`X_train` ကို ရောပြီး fit လုပ်ကြည့်ပါ — accuracy result ဘယ်လို ကွဲသွားလဲ ကိုယ်တိုင် သက်သေပြကြည့်ပါ။

သတိလေးတစ်ချက်

ဒီ round မှာ real dataset/production model ကို မလိုအပ်ပါဘူး — concept/debugging logic ကိုပဲ အဓိကထား practice လုပ်ခြင်းပါ။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Regression/Classification ကို 'ML algorithm အားလုံးအတွက် တူညီတဲ့ evaluation approach သုံးလို့ရတယ်' လို့ ရှုပ်ထွေးနေခြင်း — R² (regression) နှင့် Accuracy/Precision/Recall (classification) က မတူပါ
  • Data leakage bug ကို code review လုပ်ရာမှာ variable name (X_train vs X_test) ကို သေချာမစစ်ဆေးဘဲ ကျော်သွားခြင်း

အခု ကိုယ်တိုင် စမ်းကြည့်

ကိုယ်ပိုင် ML pipeline code (sample) ရေးပြီး တမင် `X_test`/`X_train` ကို ရောပြီး fit လုပ်ကြည့်ပါ — accuracy result ဘယ်လို ကွဲသွားလဲ ကိုယ်တိုင် သက်သေပြကြည့်ပါ။

You'll know it worked when: Supervised/Unsupervised ကွာခြားချက်၊ data leakage bug ရှာဖွေခြင်း၊ class imbalance awareness ရရှိလာမည်။

လက်တွေ့ လေ့ကျင့်ခန်း အစုံ ၁ | Thuta Learning