Skip to content

Add quantile loss as metric #18911

Closed
@lorentzenchr

Description

@lorentzenchr

Describe the workflow you want to enable

I'd like to evaluate and compare the predictive performance of (conditional) quantiles as predicted by GradientBoostingRegressor(loss='quantile', alpha=0.9) for example.

Describe your proposed solution

Implement a new metric quantile_loss(y_true, y_pred, alpha=0.5), Eq. (24) of https://arxiv.org/pdf/0912.0902.pdf.

This is the same loss as in Koenker's book "Quantile Regression" and in:

if sample_weight is None:
loss = (alpha * diff[mask].sum() -
(1 - alpha) * diff[~mask].sum()) / y.shape[0]
else:
loss = ((alpha * np.sum(sample_weight[mask] * diff[mask]) -
(1 - alpha) * np.sum(sample_weight[~mask] *
diff[~mask])) / sample_weight.sum())

Metadata

Metadata

Assignees

No one assigned

    Labels

    ModerateAnything that requires some knowledge of conventions and best practicesNew Featuremodule:metrics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions