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

Pinball loss for quantile predictions #3279

Open
trdvangraft opened this issue Mar 24, 2021 · 4 comments
Open

Pinball loss for quantile predictions #3279

trdvangraft opened this issue Mar 24, 2021 · 4 comments

Comments

@trdvangraft
Copy link
Contributor

Is your feature request related to a problem? Please describe.

For a regression problem, you are often not interested in the actual outcome but more in the boundary where the outcomes lay between. This can be achieved through for example taking a quantile output. This however often requires taking the quantile loss function (Pinball loss), which is not natively supported within Fastai. I think that fastai can benefit from this loss function or at the very least give more flexibility to the user.

Describe the solution you'd like
I would like to implement the quantile loss function similarly how it is done in the following post.
TLDR: def quantile_loss(q, y_p, y): e = y_p-y return tf.keras.backend.mean(tf.keras.backend.maximum(q*e, (q-1)*e))

Describe alternatives you've considered
Afaik there are no alternatives to the quantile loss function as suggested in this issue.

Additional context
I am completely able to implement this function myself, however I thought it would be nice to test if there was any interest into this function

@Sandy4321
Copy link

great idea
thanks
when it will be ready ?

@Sandy4321
Copy link

it is not implemented yet
https://docs.fast.ai/losses.html#DiceLoss
class BaseLoss
class CrossEntropyLossFlat
class FocalLoss
class FocalLossFlat
class BCEWithLogitsLossFlat
BCELossFlat
MSELossFlat
L1LossFlat
class LabelSmoothingCrossEntropy
class LabelSmoothingCrossEntropyFlat
class DiceLoss

@ThomasBourgeois
Copy link

That would clearly be a great add-on.

@KossaiSbai
Copy link

If people are still interested in having that function implemented, more than happy to take this on

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

5 participants