Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] address pd.DataFrame.groupby(axis=1) deprecation in EnsembleForecaster #5707

Merged
merged 4 commits into from Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions sktime/forecasting/compose/_ensemble.py
Expand Up @@ -364,8 +364,14 @@ def _predict(self, fh, X):
"""
names, _ = self._check_forecasters()
y_pred = pd.concat(self._predict_forecasters(fh, X), axis=1, keys=names)
y_pred = y_pred.groupby(level=1, axis=1).agg(
_aggregate, self.aggfunc, self.weights
y_pred = (
y_pred.T.groupby(level=1)
.agg(
lambda y, aggfunc, weights: _aggregate(y.T, aggfunc, weights),
self.aggfunc,
self.weights,
)
.T
)
return y_pred

Expand Down