tensorflow / addons

Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
Apache License 2.0
1.69k stars 611 forks source link

Add pinball loss #586

Closed RomainBrault closed 4 years ago

RomainBrault commented 5 years ago

Describe the feature and the current behavior/state.

The pinball loss is a very simple modification of the MAE and allows (conditional) quantile regression. This is rather simple to code, and would be of interest for a large community.

This has been submitted to TensorFlow (tensorflow/tensorflow#32871) and redirected here.

A pull request is open (#579)

Relevant information

Which API type would this fall under (layer, metric, optimizer, etc.)

metrics and losses (Keras)

Who will benefit with this feature?

People in econmics, biology. To model data uncertainty / distribution.

Any other info.

Sandy4321 commented 2 years ago

do you have full example for multivariate quantile regressing with using model = tf.keras.Model() model.compile('sgd', loss=tfa.losses.PinballLoss(tau=.1))

from https://www.tensorflow.org/addons/api_docs/python/tfa/losses/PinballLoss