@@ -1512,12 +1512,22 @@ def d2_pinball_score(
1512
1512
return np .average (output_scores , weights = avg_weights )
1513
1513
1514
1514
1515
+ @validate_params (
1516
+ {
1517
+ "y_true" : ["array-like" ],
1518
+ "y_pred" : ["array-like" ],
1519
+ "sample_weight" : ["array-like" , None ],
1520
+ "multioutput" : [
1521
+ StrOptions ({"raw_values" , "uniform_average" }),
1522
+ "array-like" ,
1523
+ ],
1524
+ }
1525
+ )
1515
1526
def d2_absolute_error_score (
1516
1527
y_true , y_pred , * , sample_weight = None , multioutput = "uniform_average"
1517
1528
):
1518
1529
"""
1519
- :math:`D^2` regression score function, \
1520
- fraction of absolute error explained.
1530
+ :math:`D^2` regression score function, fraction of absolute error explained.
1521
1531
1522
1532
Best possible score is 1.0 and it can be negative (because the model can be
1523
1533
arbitrarily worse). A model that always uses the empirical median of `y_true`
@@ -1536,7 +1546,7 @@ def d2_absolute_error_score(
1536
1546
y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
1537
1547
Estimated target values.
1538
1548
1539
- sample_weight : array-like of shape (n_samples,), optional
1549
+ sample_weight : array-like of shape (n_samples,), default=None
1540
1550
Sample weights.
1541
1551
1542
1552
multioutput : {'raw_values', 'uniform_average'} or array-like of shape \
0 commit comments