Skip to content

Commit

Permalink
[ENH] Clearer error message on fitting fail of evaluate (#4545)
Browse files Browse the repository at this point in the history
This PR improves the error message raised in `evaluate` when fitting
fails for a forecaster.

Raised by sevs on discord.
  • Loading branch information
fkiraly committed May 11, 2023
1 parent f64032d commit b17abce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sktime/forecasting/model_evaluation/_functions.py
Expand Up @@ -184,10 +184,11 @@ def _evaluate_window(
else:
warnings.warn(
f"""
Fitting of forecaster failed, you can set error_score='raise' to see
In evaluate, fitting of forecaster {type(forecaster).__name__} failed,
you can set error_score='raise' in evaluate to see
the exception message. Fit failed for len(y_train)={len(y_train)}.
The score will be set to {error_score}.
Failed forecaster: {forecaster}.
Failed forecaster with parameters: {forecaster}.
""",
FitFailedWarning,
stacklevel=2,
Expand Down

0 comments on commit b17abce

Please sign in to comment.