Regression হলো supervised learning-এর এমন একটি problem যেখানে target একটি numerical quantity।

সাধারণভাবে target continuous numerical হলে regression ব্যবহার করা হয়।

Examples

House Price
Delivery ETA
Temperature
Revenue
Demand
Customer Lifetime Value
Travel Time

উদাহরণ:

Input:
Distance = 5 km
Traffic  = High
Weather  = Rainy

Output:
Delivery ETA = 37.4 minutes

এখানে output কোনো class নয়।

এটি একটি numerical value।

Regression Metrics

Regression model evaluate করার জন্য common metrics হলো:

MAE
MSE
RMSE
R²
MAPE

এর মধ্যে MAE, MSE এবং RMSE খুব common।

MAE — Mean Absolute Error

Formula:

$$\text{ MAE } = \frac{1}{n}\sum_{i = 1}^{n}|y_{i} - {\hat{y}}_{i}|$$

অর্থাৎ প্রতিটি prediction-এর absolute error বের করে average করা হয়।

Example

ধরুন Delivery ETA model-এর:

MAE = 4 minutes

তার মানে predictions actual delivery time থেকে average-এ প্রায় 4 minutes দূরে।

এ কারণে MAE business stakeholder-কে explain করা সহজ।

MSE — Mean Squared Error

Formula:

$$\text{ MSE } = \frac{1}{n}\sum_{i = 1}^{n}\left( y_{i} - {\hat{y}}_{i} \right)^{2}$$

এখানে error square করা হয়।

তাই বড় error অনেক বেশি penalty পায়।

উদাহরণ:

Error = 2
Squared error = 4

Error = 10
Squared error = 100

দেখা যাচ্ছে বড় error-এর impact অনেক বেশি।

RMSE — Root Mean Squared Error

Formula:

$$\text{ RMSE } = \sqrt{\text{MSE}}$$

MSE-এর সমস্যা হলো error square করার কারণে unit-ও squared হয়ে যায়।

যেমন target যদি minutes হয়, MSE-এর unit হয়:

minutes²

RMSE square root নেওয়ার কারণে original unit-এ ফিরে আসে।

RMSE = 6 minutes

তাই interpret করা তুলনামূলক সহজ।

MAE vs RMSE

MAE:

All errors roughly equally weighted
More robust to large outliers
Easy interpretation

RMSE:

Large errors get much stronger penalty
Sensitive to outliers
Useful when large mistakes are especially costly

Example

ধরুন Delivery ETA prediction-এ:

Actual ETA    = 30 min
Prediction A  = 35 min
Prediction B  = 70 min

যদি 40-minute error business-এর জন্য খুব costly হয়, RMSE এমন large error-কে বেশি punish করবে।

Important Note

Lower MAE/RMSE = Better

কিন্তু metric blindly choose করা উচিত নয়।

Business cost কীভাবে grow করে সেটা বুঝতে হবে।

Interview-ready Explanation

Regression is a supervised learning problem where the
target is numerical.

MAE measures the average absolute prediction error and is
easy to interpret.

MSE squares the errors, so large mistakes receive a much
larger penalty.

RMSE is the square root of MSE and therefore returns the
error to the original target unit.

MAE is generally more robust to outliers, while RMSE is
useful when large errors should be penalized more strongly.