@@ -1512,12 +1512,22 @@ def d2_pinball_score(
15121512 return np .average (output_scores , weights = avg_weights )
15131513
15141514
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+ )
15151526def d2_absolute_error_score (
15161527 y_true , y_pred , * , sample_weight = None , multioutput = "uniform_average"
15171528):
15181529 """
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.
15211531
15221532 Best possible score is 1.0 and it can be negative (because the model can be
15231533 arbitrarily worse). A model that always uses the empirical median of `y_true`
@@ -1536,7 +1546,7 @@ def d2_absolute_error_score(
15361546 y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
15371547 Estimated target values.
15381548
1539- sample_weight : array-like of shape (n_samples,), optional
1549+ sample_weight : array-like of shape (n_samples,), default=None
15401550 Sample weights.
15411551
15421552 multioutput : {'raw_values', 'uniform_average'} or array-like of shape \
0 commit comments