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
Feature request: include mean absolute error (MAE) as scorer in sklearn.linear_model.ElasticNetCV #9779
Comments
I think glmnet only supports MAE for scoring but not for fitting. Do I miss
something?
|
@agramfort You're right, I didn't read the glmnet documentation closely enough. There's a |
Does that mean we should close this? |
yes or allow a scoring parameter in Linear model CV objects...
|
The feature I'm asking for would be similar to creating an elastic net CV for sklearn.linear_model.HuberRegressor.html (i.e. regularized Huber regression). |
sounds doable and useful but first we need to support elastic-net penalty
in HuberRegressor. it's doable while sticking with L-BFGS-B or we need to
write a fast coordinate descent code. It's a bit of work...
|
Ok. I'm glad you think it's doable and useful! |
now we "just" need someone to take a stab at it :)
|
Description
In scikit-learn v0.19.0, ElasticNet minimizes the objective function:
In words, the objective function is mean squared error (MSE) loss on the predicted variable, plus regularization terms. My feature request is to include an argument (with 'mse' as its default value) that would allow the user to switch to mean absolute error (MAE) loss on the predicted variable. For the equivalent in R, see https://cran.r-project.org/web/packages/glmnet/glmnet.pdf, particularly the documentation for cv.glmnet:
It would be great to also allow this functionality in sklearn.
Edit: as @agramfort pointed out below, glmnet only supports MAE for cross-validation, but not for model fitting. My request is to add an option for MAE in sklearn ElasticNet model fitting. This already exists in sklearn.ensemble.GradientBoostingRegressor (loss='quantile' and alpha=0.50), if I am reading the documentation correctly. There's also a linear-regression-with-MAE-loss option in sklearn.linear_model.HuberRegressor.html, if epsilon=0.0 ("The Huber Regressor optimizes the squared loss for the samples where
|(y - X'w) / sigma| < epsilon
and the absolute loss for the samples where|(y - X'w) / sigma| > epsilon
").The text was updated successfully, but these errors were encountered: