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

Add more D2 scores #20943

Open
lorentzenchr opened this issue Sep 4, 2021 · 13 comments · Fixed by #28351 · May be fixed by #28971
Open

Add more D2 scores #20943

lorentzenchr opened this issue Sep 4, 2021 · 13 comments · Fixed by #28351 · May be fixed by #28971

Comments

@lorentzenchr
Copy link
Member

lorentzenchr commented Sep 4, 2021

Describe the workflow you want to enable

I'd like to evaluate models by "percentage of reduction in metric X", where X is:

  • LogLoss
  • absolute error
  • pinball loss

As d2_tweedie_score #17036, these are generalizations of the r2_score.

Describe your proposed solution

Add

  • d2_log_loss_score
  • d2_absolute_error_score
  • d2_pinball_loss_score

Describe alternatives you've considered, if relevant

No response

Additional context

See #17036 (comment).

@changhsinlee
Copy link

@lorentzenchr I'm thinking about taking a stab at this. I have a two questions about d2_log_loss_score.

Q1: I can't seem to locate literature that specifically uses log_loss in computation. Any pointers here for reading on how D2 and log_loss are used together? I am not too familiar with D2 overall so anything is welcome. Already checked out the Hastie & Tibshirani reference in the docstring. Also found this paper by Guisan and Zimmermann that has an explanation closer to the "meta-score" explanation in the RFC on eq 1, pg 166.

Q2, on file structure: Given that Tweedie applies to regression models and d2_tweedie_score goes into sklearn.metrics._regression. In the case of log_loss it is a classification metric (source), does this mean d2_log_loss_score should go under sklearn.metrics._classification? Thanks.

@changhsinlee
Copy link

changhsinlee commented Dec 3, 2021

Just realized that it's the same as McFadden's R^2 which was much easier to search than D^2. Thanks for the doc!

e.g.

I think I'll take on d2_log_loss_score. Thanks. Do I need to wait for progress on #21718 ?

@lorentzenchr
Copy link
Member Author

@changhsinlee A McFadden R2 version for log loss is not controversial, IMO, so go ahead. A PR is most welcome.

@ohadmich
Copy link
Contributor

ohadmich commented Jan 2, 2022

@lorentzenchr I started working on implementing d2_absolute_error_score, I'll add a PR when it's ready for review.

@MaxwellLZH
Copy link
Contributor

Working on d2_log_loss_score

@OmarManzoor
Copy link
Contributor

Hi @MaxwellLZH
I just wanted to confirm that are you still working on d2_log_loss_score?

@MaxwellLZH
Copy link
Contributor

Hi @MaxwellLZH I just wanted to confirm that are you still working on d2_log_loss_score?

Hi @OmarManzoor, I'm not working on it at the moment, you can go ahead :)

@OmarManzoor
Copy link
Contributor

Hi @MaxwellLZH I just wanted to confirm that are you still working on d2_log_loss_score?

Hi @OmarManzoor, I'm not working on it at the moment, you can go ahead :)

Thank you for the clarification.

@OmarManzoor
Copy link
Contributor

Hi @lorentzenchr

Is the d2_log_loss_score the D^2 version for the mean_squared_log_error?

@lorentzenchr
Copy link
Member Author

@OmarManzoor No, d2_log_loss_score is for log_loss and not yet implemented.

@OmarManzoor
Copy link
Contributor

OmarManzoor commented Jan 12, 2023

@OmarManzoor No, d2_log_loss_score is for log_loss and not yet implemented.

I see. Could you kindly provide some reference to the specification of log_loss so that I can get some guidance on how to implement it? We have a log_loss defined in classification but this should be a bit different than that?

@lorentzenchr
Copy link
Member Author

I would still add a D2 Brier score and then we can finally close here.

@lorentzenchr lorentzenchr reopened this May 2, 2024
@OmarManzoor
Copy link
Contributor

I would still add a D2 Brier score and then we can finally close here.

Since the approach for this seems similar, would it be okay if I work on this too?

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

Successfully merging a pull request may close this issue.

5 participants