Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] pass user passed parameters to
ForecastX
to underlying estima…
…tors (#4391) Fixes #4386 Before this PR, `predict_interval` or `predict_quantiles` of `ForecastX` did not pass `coverage` or `alpha` parameters passed by user to the corresponding methods of `self.forecaster_y_`. This PR addresses this bug. ##### before ```pycon >>> pipe.predict_interval(fh=fh, X=X_test.drop(columns=columns), coverage=0.95) Coverage 0.9 lower upper 1960 69583.430473 70587.653223 1961 69569.814972 70576.864647 1962 72161.834476 73168.900067 >>> pipe.predict_quantiles(fh=fh, X=X_test.drop(columns=columns), alpha=[0.25, 0.75]) Quantiles 0.05 0.95 1960 69583.430473 70587.653223 1961 69569.814972 70576.864647 1962 72161.834476 73168.900067 ``` ##### after ```pycon >>> pipe.predict_interval(fh=fh, X=X_test.drop(columns=columns), coverage=0.95) Coverage 0.95 lower upper 1960 69487.239242 70683.844453 1961 69473.352959 70673.326660 1962 72065.370939 73265.363604 >>> pipe.predict_quantiles(fh=fh, X=X_test.drop(columns=columns), alpha=[0.25, 0.75]) Quantiles 0.25 0.75 1960 69879.645730 70291.437965 1961 69866.864086 70279.815532 1962 72458.888285 72871.846258 ``` There are two other methods of `ForecastX` which does not use passed parameters, viz. `cov` in `_predict_var` and `marginal` in `_predict_proba`. However, these are not used even in `BaseForecaster`. I've made changes (similar to above two) so that these parameters are always passed, whether or not used by any estimator. Tests coverage will be added by other PR, see discussion there: * #4393 * #4394
- Loading branch information