ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
Linear Regression ရဲ့ formula က `y = m*x + b` (school algebra ကနေ ရင်းနှီးမှာပါ) — `m` (coefficient/slope) က feature တစ်ခုချင်းစီရဲ့ 'ဘယ်လောက် weight' ရှိလဲ ကို ဖော်ပြပြီး, `b` (intercept) က feature အားလုံး 0 ဖြစ်တဲ့အခါ baseline value ကို ဖော်ပြပါတယ်။ Multiple Linear Regression ကတော့ feature တစ်ခုထက်ပို (`y = m1*x1 + m2*x2 + ... + b`) ကို handle လုပ်နိုင်ပါတယ် — house price ကို 'size' တစ်ခုတည်းမဟုတ်ဘဲ 'size + location + age' ဆိုပြီး feature များစွာနဲ့ predict ချင်ရင် ဒီ concept ကို သုံးရပါတယ်.
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
`model.coef_` ကို print ကြည့်ရင် feature တစ်ခုချင်းစီရဲ့ coefficient ကို ကြည့်နိုင်ပါတယ် — coefficient positive ဆိုရင် feature တိုးလာရင် target တိုးလာမယ် (positive correlation), negative ဆိုရင် feature တိုးလာရင် target ကျသွားမယ် (negative correlation) ဆိုတာ interpret လုပ်နိုင်ပါတယ် — 'size' coefficient က 'age' coefficient ထက် ကြီးရင် size က price ကို ပိုသက်ရောက်တယ်ဆိုတာ ခန့်မှန်းနိုင်ပါတယ်.
အတူတူ ကြည့်မယ်
from sklearn.linear_model import LinearRegression
# Multiple features: size, age, distance to city center
X = df[['size', 'age', 'distance']]
y = df['price']
model = LinearRegression()
model.fit(X, y)
print(f"Coefficients: {model.coef_}")
print(f"Intercept: {model.intercept_}")
# e.g. Coefficients: [1200, -800, -3000]
# size: +1200 per unit, age: -800 per year, distance: -3000 per kmCoefficients: [1200.5 -800.2 -3000.1]
Intercept: 50000.0၅ မိနစ် စမ်းကြည့်
Multiple feature (size, age, distance) ပါတဲ့ sample dataset ကို Multiple Linear Regression ဖြင့် train ကြည့်ပြီး, `model.coef_` ကို print ကာ feature တစ်ခုချင်းစီရဲ့ direction (positive/negative) ကို interpret ရေးကြည့်ပါ။
သတိလေးတစ်ချက်
Multicollinearity (feature နှစ်ခု တစ်ခုနဲ့တစ်ခု correlate ကြီးမားနေခြင်း, ဥပမာ - 'size in sqft' နဲ့ 'size in sqm') ရှိရင် coefficient ကို reliably interpret မရနိုင်ပါ — redundant feature ကို remove လုပ်သင့်ပါတယ်.