1
$\begingroup$

I was looking at the arguments in the linear regularization methods with cross validation within scikit-learn. RidgeCV has an argument scoring which is None by default but one can use a custom scorer (e.g. RMSE). I noticed that no such option is given for the rest of the classes (LassoCV, LassoLarsCV, ElasticNetCV). Why is this? Is MSE used by default in all of them?

$\endgroup$
3
$\begingroup$

RidgeCV implements CV by GridSearchCV, which supports custom scorer.

However, LassoCV and ElasticNetCV implement CV by LinearModelCV, with MSE as scoring hard-coded. LassoLarsCV impletments CV by LarsCV, with MSE as scoring hard-coded too.

If you want to use other scorers, maybe you can use GridSearchCV directly.

References

https://github.com/scikit-learn/scikit-learn/blob/14031f6/sklearn/linear_model/ridge.py#L1092

https://github.com/scikit-learn/scikit-learn/blob/14031f6/sklearn/linear_model/coordinate_descent.py#L1181

https://github.com/scikit-learn/scikit-learn/blob/14031f6/sklearn/linear_model/least_angle.py#L1143

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.