Repository: sktime/sktime

Issue:
[ENH] Explicitly specify `min_periods` in `WindowSummarizer` to avoid different behaviour in the future
**Is your feature request related to a problem? Please describe.**

Yes. As noticed by @KishManani in the slack, using `pandas` 1.5.2 for rolling operations (e.g. `df.rolling(window=window_size).mean()` ) throws a future warning:

```
FutureWarning: min_periods=None will default to the size of window consistent with other methods in a future version. Specify min_periods=0 instead.
```
So, it means that the behaviour of `WindowSummarizer` transformer (which uses `rolling` and doesn't specify `min_periods` at the moment) will change if in future `pandas` changes the default behaviour to be `min_periods=0`.


**Describe the solution you'd like**
Explicitly specifying `min_period` with the value of window length can make `WindowSummarizer` to retain it's behaviour even after `pandas` changes the default.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.



Discussion:

Resolving patch:
diff --git a/sktime/forecasting/online_learning/_prediction_weighted_ensembler.py b/sktime/forecasting/online_learning/_prediction_weighted_ensembler.py
--- a/sktime/forecasting/online_learning/_prediction_weighted_ensembler.py
+++ b/sktime/forecasting/online_learning/_prediction_weighted_ensembler.py
@@ -4,8 +4,7 @@
 """Implements online algorithms for prediction weighted ensembles."""
 
 import numpy as np
-from scipy.optimize import bisect
-from scipy.optimize import nnls
+from scipy.optimize import bisect, nnls
 
 
 class _PredictionWeightedEnsembler:
@@ -213,7 +212,7 @@ def _pot(c):
             -------
             potential: float
             """
-            return np.mean(np.exp((R_plus ** 2) / (2 * c))) - np.e
+            return np.mean(np.exp((R_plus**2) / (2 * c))) - np.e
 
         c_t = bisect(_pot, low_c, high_c)
 
@@ -232,7 +231,7 @@ def _prob(r, c_t):
             prob : float
                 probability
             """
-            return (r / c_t) * np.exp((r ** 2) / (2 * c_t))
+            return (r / c_t) * np.exp((r**2) / (2 * c_t))
 
         self.weights = np.array([_prob(r, c_t) for r in R_plus])
         self.weights /= np.sum(self.weights)
diff --git a/sktime/transformations/series/summarize.py b/sktime/transformations/series/summarize.py
--- a/sktime/transformations/series/summarize.py
+++ b/sktime/transformations/series/summarize.py
@@ -437,22 +437,36 @@ class description for in-depth explanation.
     if summarizer in pd_rolling:
         if isinstance(Z, pd.core.groupby.generic.SeriesGroupBy):
             if bfill is False:
-                feat = getattr(Z.shift(lag).rolling(window_length), summarizer)()
+                feat = getattr(
+                    Z.shift(lag).rolling(
+                        window=window_length, min_periods=window_length
+                    ),
+                    summarizer,
+                )()
             else:
                 feat = getattr(
-                    Z.shift(lag).fillna(method="bfill").rolling(window_length),
+                    Z.shift(lag)
+                    .fillna(method="bfill")
+                    .rolling(window=window_length, min_periods=window_length),
                     summarizer,
                 )()
             feat = pd.DataFrame(feat)
         else:
             if bfill is False:
                 feat = Z.apply(
-                    lambda x: getattr(x.shift(lag).rolling(window_length), summarizer)()
+                    lambda x: getattr(
+                        x.shift(lag).rolling(
+                            window=window_length, min_periods=window_length
+                        ),
+                        summarizer,
+                    )()
                 )
             else:
                 feat = Z.apply(
                     lambda x: getattr(
-                        x.shift(lag).fillna(method="bfill").rolling(window_length),
+                        x.shift(lag)
+                        .fillna(method="bfill")
+                        .rolling(window=window_length, min_periods=window_length),
                         summarizer,
                     )()
                 )
@@ -469,7 +483,9 @@ class description for in-depth explanation.
             summarizer
         ):
             feat = feat.apply(
-                lambda x: x.rolling(window_length).apply(summarizer, raw=True)
+                lambda x: x.rolling(
+                    window=window_length, min_periods=window_length
+                ).apply(summarizer, raw=True)
             )
         feat = pd.DataFrame(feat)
     if bfill is True:


Test patch: