File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ def regression_coverage_score(
1919 y_true : ArrayLike ,
2020 y_pred_low : ArrayLike ,
2121 y_pred_up : ArrayLike ,
22- warning_inf : bool = False
2322) -> float :
2423 """
2524 Effective coverage score obtained by the prediction intervals.
@@ -58,15 +57,14 @@ def regression_coverage_score(
5857 check_arrays_length (y_true , y_pred_low , y_pred_up )
5958 check_lower_upper_bounds (y_true , y_pred_low , y_pred_up )
6059 check_array_nan (y_true )
61- check_array_inf (y_true , warning_inf = warning_inf )
60+ check_array_inf (y_true )
6261 check_array_nan (y_pred_low )
63- check_array_inf (y_pred_low , warning_inf = warning_inf )
62+ check_array_inf (y_pred_low )
6463 check_array_nan (y_pred_up )
65- check_array_inf (y_pred_up , warning_inf = warning_inf )
64+ check_array_inf (y_pred_up )
6665
6766 coverage = np .mean (
68- ((y_pred_low <= y_true ) & (y_pred_up >= y_true )) |
69- np .isinf (y_pred_low ) | np .isinf (y_pred_up )
67+ ((y_pred_low <= y_true ) & (y_pred_up >= y_true ))
7068 )
7169 return float (coverage )
7270
Original file line number Diff line number Diff line change @@ -1280,7 +1280,7 @@ def check_array_nan(array: NDArray) -> None:
12801280 )
12811281
12821282
1283- def check_array_inf (array : NDArray , warning_inf : bool = False ) -> None :
1283+ def check_array_inf (array : NDArray ) -> None :
12841284 """
12851285 Checks if the array have inf.
12861286 If a value is infinite, we throw an error.
@@ -1296,12 +1296,9 @@ def check_array_inf(array: NDArray, warning_inf: bool = False) -> None:
12961296 If any elements of the array is +inf or -inf.
12971297 """
12981298 if np .isinf (array ).any ():
1299- if warning_inf :
1300- warnings .warn ("Array contains infinite values." , UserWarning )
1301- else :
1302- raise ValueError (
1303- "Array contains infinite values."
1304- )
1299+ raise ValueError (
1300+ "Array contains infinite values."
1301+ )
13051302
13061303
13071304def check_arrays_length (* arrays : NDArray ) -> None :
You can’t perform that action at this time.
0 commit comments