AIX360 icon indicating copy to clipboard operation
AIX360 copied to clipboard

How to execute the metrics on regression problems instead of classification?

Open survivebycoding opened this issue 2 years ago • 2 comments

The examples given in metrics is for classification and not regression. Any example to implement faithfulness and monotonicity on regression?

survivebycoding avatar Aug 17 '22 10:08 survivebycoding

had the same inquiries. As the faithfulness and monotonicity metrics are based on the classification model (using classification mode.predic_proba), is there a way to use it on a regression model instead?

CHr0m31 avatar Sep 01 '22 07:09 CHr0m31

In regression problems, the goal is to predict a continuous numeric output rather than a categorical label as in classification problems. The evaluation metrics for regression problems differ from those used in classification. Here are some common metrics used to evaluate the performance of regression models:

Mean Absolute Error (MAE):

Formula: ( MAE = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i| ) MAE represents the average absolute difference between the actual and predicted values. It is easy to interpret, as it gives the average magnitude of the errors. Mean Squared Error (MSE):

Formula: ( MSE = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2 ) MSE squares the errors before averaging them, giving more weight to large errors. It is widely used but sensitive to outliers. Root Mean Squared Error (RMSE):

Formula: ( RMSE = \sqrt{MSE} ) RMSE is the square root of MSE and is also commonly used. It has the advantage of being in the same unit as the target variable, making it more interpretable. R-squared (R2) Score:

Formula: ( R^2 = 1 - \frac{\sum_{i=1}^{n} (y_i - \hat{y}i)^2}{\sum{i=1}^{n} (y_i - \bar{y})^2} ) R2 measures the proportion of the variance in the dependent variable that is predictable from the independent variables. It ranges from 0 to 1, where 1 indicates perfect predictions. Mean Absolute Percentage Error (MAPE):

Formula: ( MAPE = \frac{1}{n} \sum_{i=1}^{n} \left|\frac{y_i - \hat{y}_i}{y_i}\right| \times 100 ) MAPE expresses the average percentage difference between the predicted and actual values. It is useful when you want to understand the prediction error as a percentage of the actual values. Adjusted R-squared:

Formula: ( \bar{R^2} = 1 - \frac{(1-R^2)(n-1)}{n-p-1} ) Adjusted R2 penalizes the addition of irrelevant predictors in regression models. It is especially useful when dealing with multiple independent variables. When evaluating regression models, it's important to choose metrics that align with the specific goals of your analysis. For example, MAE and RMSE are often preferred for their simplicity, while R2 provides a measure of goodness-of-fit. The choice of metric depends on the context and the specific requirements of your regression problem.

wucahngxi avatar Nov 25 '23 05:11 wucahngxi