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

D2_pinball_score #28671

Open
Manjubn777 opened this issue Mar 20, 2024 · 2 comments
Open

D2_pinball_score #28671

Manjubn777 opened this issue Mar 20, 2024 · 2 comments

Comments

@Manjubn777
Copy link

Hello team, I’m currently utilizing RandomizedSearchCV . Specifically, I’m working on probabilistic forecasting. However, when I use D2_pinball_score as the scoring metric, I encounter an error despite using the supported version. Any insights or guidance would be greatly appreciated.

image

@github-actions github-actions bot added the Needs Triage Issue requires triage label Mar 20, 2024
@ogrisel ogrisel added Documentation and removed Needs Triage Issue requires triage Documentation labels Mar 20, 2024
@ogrisel
Copy link
Member

ogrisel commented Mar 20, 2024

"d2_pinball_score" is not a valid scorer name. You should instead pass a custom scorer object that wraps the d2_pinball_score callable with the value of alpha you are interested in:

from sklearn.metrics import make_scorer
from sklearn.metrics import d2_pinball_score

pinball_95_scorer = make_scorer(d2_pinball_score, alpha=0.95) 

Then you should be able to pass scoring=pinball_95_scorer to the RandomizedSearchCV constructor.

More details:

https://scikit-learn.org/stable/modules/generated/sklearn.metrics.make_scorer.html

I agree that both the documentation for the scoring parameter, the make_scorer utility, the d2_pinball_score metric and the error message could be improved because this is not easy to discover the correct usage by yourself.

@siddu1324
Copy link

siddu1324 commented Mar 25, 2024

I'm working on scikit-learn/sklearn/model_selection/_search.py

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

No branches or pull requests

4 participants