จาก ep ก่อนที่เราสอนเรื่อง Regression มีการพูดถึง MSE Loss Fuction ใน ep นี้เราจะมาเจาะลึกกันเรื่อง Loss ที่นิยมใช้ใน งาน Regression มีอะไรบ้าง แล้วข้อดีข้อเสียของแต่ละตัวเป็นอย่างไร เราควรเลือกใช้ตัวไหนเมื่อไร

gradient descent Credit: Lecture 2 | Machine Learning (Stanford) https://www.youtube.com/watch?v=5u4G23_OohI
gradient descent Credit: Lecture 2 | Machine Learning (Stanford) https://www.youtube.com/watch?v=5u4G23_OohI

Loss Function ที่นิยมใช้ในงาน Regression ในปัจจุบัน มีหลายตัว ตัวอย่างเช่น Mean Absolute Error (MAE) หรือ L1 Loss , Mean Squared Error (MSE) หรือ L2 Loss , Root Mean Squared Error (RMSE)

สูตร MAE

\( \mathrm{MAE} = \frac{\sum_{i=1}^n\left| y_i-\hat{y_i}\right|}{n} \)

สูตร MSE

\( \operatorname{MSE}=\frac{1}{n}\sum_{i=1}^n(Y_i-\hat{Y_i})^2 \)

สูตร RMSE

\( \operatorname{RMSD}=\sqrt{\frac{\sum_{i=1}^n ( y_i – \hat y_i)^2}{n}} \)

เรามาเริ่มกันเลย

Open In Colab

แชร์ให้เพื่อน:

Surapong Kanoktipsatharporn on FacebookSurapong Kanoktipsatharporn on LinkedinSurapong Kanoktipsatharporn on Rss
Surapong Kanoktipsatharporn
Solutions Architect at Bua Labs
The ultimate test of your knowledge is your capacity to convey it to another.

Published by Surapong Kanoktipsatharporn

The ultimate test of your knowledge is your capacity to convey it to another.