-
-
Notifications
You must be signed in to change notification settings - Fork 26.1k
Closed
Labels
ModerateAnything that requires some knowledge of conventions and best practicesAnything that requires some knowledge of conventions and best practicesNew Featuremodule:metrics
Description
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:
scikit-learn/sklearn/ensemble/_gb_losses.py
Lines 461 to 467 in ad3c288
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
Labels
ModerateAnything that requires some knowledge of conventions and best practicesAnything that requires some knowledge of conventions and best practicesNew Featuremodule:metrics