Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
survivebycoding opened this issue Aug 17, 2022 · 2 comments

Comments

@survivebycoding
Copy link

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

@CHr0m31
Copy link

CHr0m31 commented Sep 1, 2022

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?

@wucahngxi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants