internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: sktime/sktime

Issue:
[DOC] `pd.DataFrame` output schema of `evaluate` needs to be documented properly in docstring
The docstring of `evaluate` in the `forecasting.model_evaluation` module only tells the user that the return is `pd.DataFrame` without further description of the schema.

Best way to glean the schema is to run the example; alternatively, the schema is tested by calls to `_check_evaluate_output` in the tests.


Discussion:

Resolving patch:
diff --git a/sktime/forecasting/model_evaluation/_functions.py b/sktime/forecasting/model_evaluation/_functions.py
--- a/sktime/forecasting/model_evaluation/_functions.py
+++ b/sktime/forecasting/model_evaluation/_functions.py
@@ -263,9 +263,23 @@ def evaluate(
 
     Returns
     -------
-    pd.DataFrame
+    results : pd.DataFrame or dask.dataframe.DataFrame
         DataFrame that contains several columns with information regarding each
         refit/update and prediction of the forecaster.
+        Row index is splitter index of train/test fold in `cv`.
+        Entries in the i-th row are for the i-th train/test split in `cv`.
+        Columns are as follows:
+        - test_{scoring.name}: (float) Model performance score.
+        - fit_time: (float) Time in sec for `fit` or `update` on train fold.
+        - pred_time: (float) Time in sec to `predict` from fitted estimator.
+        - len_train_window: (int) Length of train window.
+        - cutoff: (int, pd.Timestamp, pd.Period) cutoff = last time index in train fold.
+        - y_train: (pd.Series) only present if see `return_data=True`
+          train fold of the i-th split in `cv`, used to fit/update the forecaster.
+        - y_pred: (pd.Series) present if see `return_data=True`
+          forecasts from fitted forecaster for the i-th test fold indices of `cv`.
+        - y_test: (pd.Series) present if see `return_data=True`
+          testing fold of the i-th split in `cv`, used to compute the metric.
 
     Examples
     --------
@@ -338,7 +352,7 @@ def evaluate(
             )
         X = convert_to(X, to_type=PANDAS_MTYPES)
 
-    score_name = "test_" + scoring.name
+    score_name = f"test_{scoring.name}"
     cutoff_dtype = str(y.index.dtype)
     _evaluate_window_kwargs = {
         "fh": cv.fh,


Test patch:
Repository: sktime/sktime

Issue:
[ENH]Plot Title
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
Currently plot_series has no place to enter plot title
**Describe the solution you'd like**
A clear and concise description of what you want to happen, ideally taking into consideration the existing toolbox design, classes and methods.
It would be nice to introduce a user-defined parameter title that user can fill in.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
None
**Additional context**
Add any other context or screenshots about the feature request here.
None


Discussion:
This would be a straightforward addition, check out my PR where I [add color](https://github.com/sktime/sktime/pull/3908) as an argument to `plot_series()` if you'd like an example as a guide.

In the meantime, you can set the title after calling the function like so:
```
fig, ax = plot_series(ytrain, ytest, labels=['ytrain', 'ytest']);
ax.set_title('Test Title')
```
Thanks a lot, I will definitely give it a try
Agree that this would be a good change!  In case you are new @Dabs212 [here is our contribution guide](https://www.sktime.org/en/v0.14.1/get_involved/contributing.html).  Please reach out in the slack if you get stuck.  Sometimes the first PR can be a bit tricky as there are a few things you need to set up on your end.  Good luck and thanks for working on this solution! 
Hi @miraep8,

As this issue is still open, I would like to work on this. Can you assign it to me?
Sure thing!  Ping us when you have a PR to review :) 

Resolving patch:
diff --git a/sktime/utils/plotting.py b/sktime/utils/plotting.py
--- a/sktime/utils/plotting.py
+++ b/sktime/utils/plotting.py
@@ -23,6 +23,7 @@ def plot_series(
     labels=None,
     markers=None,
     colors=None,
+    title=None,
     x_label=None,
     y_label=None,
     ax=None,
@@ -41,6 +42,8 @@ def plot_series(
         The length of the list has to match with the number of series.
     colors: list, default = None
         The colors to use for plotting each series. Must contain one color per series
+    title: str, default = None
+        The text to use as the figure's suptitle
     pred_interval: pd.DataFrame, default = None
         Output of `forecaster.predict_interval()`. Contains columns for lower
         and upper boundaries of confidence interval.
@@ -138,6 +141,10 @@ def format_fn(tick_val, tick_pos):
     ax.xaxis.set_major_formatter(FuncFormatter(format_fn))
     ax.xaxis.set_major_locator(MaxNLocator(integer=True))
 
+    # Set the figure's title
+    if title is not None:
+        fig.suptitle(title, size="xx-large")
+
     # Label the x and y axes
     if x_label is not None:
         ax.set_xlabel(x_label)


Test patch:
Repository: sktime/sktime

Issue:
[MNT] Forgotten deprecation in `_cboss` module
https://github.com/sktime/sktime/blob/d85102ffd10f6531316015a1ac6c80c0b1687801/sktime/classification/dictionary_based/_cboss.py#L66-L73

https://github.com/sktime/sktime/blob/d85102ffd10f6531316015a1ac6c80c0b1687801/sktime/classification/dictionary_based/_cboss.py#L221-L225




Discussion:
thanks for flagging, this should be actioned for the next release.

Resolving patch:
diff --git a/sktime/classification/dictionary_based/_cboss.py b/sktime/classification/dictionary_based/_cboss.py
--- a/sktime/classification/dictionary_based/_cboss.py
+++ b/sktime/classification/dictionary_based/_cboss.py
@@ -11,7 +11,6 @@
 
 import math
 import time
-import warnings
 
 import numpy as np
 from sklearn.utils import check_random_state
@@ -63,15 +62,6 @@ class ContractableBOSS(BaseClassifier):
     contract_max_n_parameter_samples : int, default=np.inf
         Max number of parameter combinations to consider when time_limit_in_minutes is
         set.
-    typed_dict : bool, default="deprecated"
-        Use a numba TypedDict to store word counts. May increase memory usage, but will
-        be faster for larger datasets. As the Dict cannot be pickled currently, there
-        will be some overhead converting it to a python dict with multiple threads and
-        pickling.
-
-        .. deprecated:: 0.13.3
-            ``typed_dict`` was deprecated in version 0.13.3 and will be removed in 0.15.
-
     save_train_predictions : bool, default=False
         Save the ensemble member train predictions in fit for use in _get_train_probs
         leave-one-out cross-validation.
@@ -156,7 +146,6 @@ def __init__(
         min_window=10,
         time_limit_in_minutes=0.0,
         contract_max_n_parameter_samples=np.inf,
-        typed_dict="deprecated",
         save_train_predictions=False,
         feature_selection="none",
         n_jobs=1,
@@ -169,7 +158,6 @@ def __init__(
 
         self.time_limit_in_minutes = time_limit_in_minutes
         self.contract_max_n_parameter_samples = contract_max_n_parameter_samples
-        self.typed_dict = typed_dict
         self.save_train_predictions = save_train_predictions
         self.n_jobs = n_jobs
         self.random_state = random_state
@@ -218,13 +206,6 @@ def _fit(self, X, y):
         self.estimators_ = []
         self.weights_ = []
 
-        if self.typed_dict != "deprecated":
-            warnings.warn(
-                "``typed_dict`` was deprecated in version 0.13.3 and "
-                "will be removed in 0.15.",
-                stacklevel=2,
-            )
-
         # Window length parameter space dependent on series length
         max_window_searches = self.series_length_ / 4
         max_window = int(self.series_length_ * self.max_win_len_prop)


Test patch:
Repository: sktime/sktime

Issue:
[BUG] `ForecastX` does not pass parameters to proba prediction methods
`ForecastX` does not pass parameter to proba prediction methods of the inner forecaster.

It should also be checked why the tests did not capture this, as this results in the wrong column index (and I thought the column index is being checked for being as expected).

An instance of the problem was reported by @yarnabrina here:
https://github.com/sktime/sktime/discussions/4378#discussioncomment-5400582


Discussion:
@yarnabrina, since the discussion https://github.com/sktime/sktime/discussions/4378 also contains the diagnosis and solution for the bug, feel free to add yourself with a bugfixing tag to `allcontributorsrc`.

You can also make a PR to fix the bug if you like, in case you get to it in the next days.

Would be much appreciated!

Resolving patch:
diff --git a/sktime/forecasting/compose/_pipeline.py b/sktime/forecasting/compose/_pipeline.py
--- a/sktime/forecasting/compose/_pipeline.py
+++ b/sktime/forecasting/compose/_pipeline.py
@@ -1416,7 +1416,7 @@ def _predict_interval(self, fh, X=None, coverage=0.90):
                 quantile forecasts at alpha = 0.5 - c/2, 0.5 + c/2 for c in coverage.
         """
         X = self._get_forecaster_X_prediction(fh=fh, X=X)
-        y_pred = self.forecaster_y_.predict_interval(fh=fh, X=X)
+        y_pred = self.forecaster_y_.predict_interval(fh=fh, X=X, coverage=coverage)
         return y_pred
 
     def _predict_quantiles(self, fh, X, alpha):
@@ -1446,7 +1446,7 @@ def _predict_quantiles(self, fh, X, alpha):
                 at quantile probability in second col index, for the row index.
         """
         X = self._get_forecaster_X_prediction(fh=fh, X=X)
-        y_pred = self.forecaster_y_.predict_quantiles(fh=fh, X=X)
+        y_pred = self.forecaster_y_.predict_quantiles(fh=fh, X=X, alpha=alpha)
         return y_pred
 
     def _predict_var(self, fh=None, X=None, cov=False):
@@ -1486,7 +1486,7 @@ def _predict_var(self, fh=None, X=None, cov=False):
                 Note: no covariance forecasts are returned between different variables.
         """
         X = self._get_forecaster_X_prediction(fh=fh, X=X)
-        y_pred = self.forecaster_y_.predict_var(fh=fh, X=X)
+        y_pred = self.forecaster_y_.predict_var(fh=fh, X=X, cov=cov)
         return y_pred
 
     # todo: does not work properly for multivariate or hierarchical
@@ -1524,7 +1524,7 @@ def _predict_proba(self, fh, X, marginal=True, legacy_interface=None):
         """
         X = self._get_forecaster_X_prediction(fh=fh, X=X)
         y_pred = self.forecaster_y_.predict_proba(
-            fh=fh, X=X, legacy_interface=legacy_interface
+            fh=fh, X=X, marginal=marginal, legacy_interface=legacy_interface
         )
         return y_pred
 


Test patch:
Repository: sktime/sktime

Issue:
[BUG] `BaggingForecaster` returns incorrect index for probabilistic forecasts
Same as https://github.com/sktime/sktime/issues/4362, but for `BaggingForecaster`


Discussion:

Resolving patch:
diff --git a/sktime/forecasting/compose/_bagging.py b/sktime/forecasting/compose/_bagging.py
--- a/sktime/forecasting/compose/_bagging.py
+++ b/sktime/forecasting/compose/_bagging.py
@@ -262,7 +262,6 @@ def _predict_quantiles(self, fh, X=None, alpha=None):
         """
         # X is ignored
         y_pred = self.forecaster_.predict(fh=fh, X=None)
-
         return _calculate_data_quantiles(y_pred, alpha)
 
     def _update(self, y, X=None, update_params=True):
@@ -338,8 +337,7 @@ def _calculate_data_quantiles(df: pd.DataFrame, alpha: List[float]) -> pd.DataFr
     index = pd.MultiIndex.from_product([["Quantiles"], alpha])
     pred_quantiles = pd.DataFrame(columns=index)
     for a in alpha:
-        pred_quantiles[("Quantiles", a)] = (
-            df.groupby(level=-1, as_index=True).quantile(a).squeeze()
-        )
+        quant_a = df.groupby(level=-1, as_index=True).quantile(a)
+        pred_quantiles[[("Quantiles", a)]] = quant_a
 
     return pred_quantiles


Test patch:
diff --git a/sktime/tests/_config.py b/sktime/tests/_config.py
--- a/sktime/tests/_config.py
+++ b/sktime/tests/_config.py
@@ -127,12 +127,6 @@
     # SAX returns strange output format
     # this needs to be fixed, was not tested previously due to legacy exception
     "SAX": "test_fit_transform_output",
-    # known bug in BaggingForecaster, returns wrong index, #4363
-    "BaggingForecaster": [
-        "test_predict_interval",
-        "test_predict_quantiles",
-        "test_predict_proba",
-    ],
     # known bug in DynamicFactor, returns wrong index, #4362
     "DynamicFactor": [
         "test_predict_interval",
Repository: sktime/sktime

Issue:
[DOC] change default documentation version from `latest` (`main` branch) to `stable` (latest tag) in read-the-docs configuration
Currently the [documentation website](https://www.sktime.net) defaults to `latest`, i.e. the `main` branch. So, it is possible that it shows some estimators or arguments which are not yet released and won't be available for the general users who download from `PyPI` or `conda-forge`.

Read-the docs allow to change the default version, and it can be considered to switch to `stable` to refer to [latest semantic version](https://docs.readthedocs.io/en/stable/versions.html). This is likely to be what's used by most of the direct users of `sktime` (i.e. not through another framework whose dependency is `sktime`).

To make the change, the read-the-docs owner can log in, go to `Admin`, go to `Advanced Settings`, change `Default version` and save the changes. It's likely to trigger a new build and then will be in effect once it's complete.


Discussion:
I know - it is on `latest` by default, so documentation updates can happen without package releases - e.g., announcements the internships, developer events etc; or, fixes to the documentation.

The downside indeed is that some estimators that aren't available appear as available.

We've never had a proper discussion of pros/cons though as far as I can remember, so it's probably worth having it, i.e., what is better for the user.
(example: the `stable` release for 0.19.1 had a duplication fo the 0.19.0 release notes by accident. This was easy to fix by a PR post release as we are pointing to `latest`)
I see. In that case, is it possible to keep the default as `latest` for your above reasons, but display a FYI banner? An example of that is present in [`elyra` documentation](https://elyra.readthedocs.io/).

> This document is for the development version. For the stable version documentation, see here.
> In that case, is it possible to keep the default as latest for your above reasons, but display a FYI banner?

Yes, that seems like a great compromise, have your cake and eat it.

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -49,6 +49,7 @@
     "myst_parser",
     "sphinx_design",
     "sphinx_issues",
+    "versionwarning.extension",
 ]
 
 # Recommended by sphinx_design when using the MyST Parser
@@ -435,3 +436,15 @@ def adds(pth):
 
 # -- Options for _todo extension ----------------------------------------------
 todo_include_todos = False
+
+# sphinx-version-warning config
+versionwarning_messages = {
+    "latest": (
+        "This document is for the development version. "
+        'For the stable version documentation, see <a href="/en/stable/">here</a>.'
+    )
+}
+
+# Show warning at top of page
+versionwarning_body_selector = "div.document"
+versionwarning_banner_title = ""


Test patch:
Repository: sktime/sktime

Issue:
[DOC] docstring example in `FhPlexForecaster` is for the wrong forecaster
The docstring example in `FhPlexForecaster` is for the wrong forecaster - but it should be illustrative examples for use of `FhPlexForecaster`.


Discussion:

Resolving patch:
diff --git a/sktime/forecasting/compose/_fhplex.py b/sktime/forecasting/compose/_fhplex.py
--- a/sktime/forecasting/compose/_fhplex.py
+++ b/sktime/forecasting/compose/_fhplex.py
@@ -55,15 +55,29 @@ class FhPlexForecaster(BaseForecaster):
 
     Examples
     --------
+    >>> from sktime.datasets import load_airline
     >>> from sktime.forecasting.naive import NaiveForecaster
-    >>> from sktime.forecasting.compose import ForecastByLevel
-    >>> from sktime.utils._testing.hierarchical import _make_hierarchical
-    >>> y = _make_hierarchical()
-    >>> f = ForecastByLevel(NaiveForecaster(), groupby="local")
-    >>> f.fit(y)
-    ForecastByLevel(...)
-    >>> fitted_forecasters = f.forecasters_
-    >>> fitted_forecasters_alt = f.get_fitted_params()["forecasters"]
+    >>> from sktime.forecasting.compose import FhPlexForecaster
+
+    Simple example - same parameters per fh element
+    >>> y = load_airline()
+    >>> f = FhPlexForecaster(NaiveForecaster())
+    >>> f.fit(y, fh=[1, 2, 3])
+    FhPlexForecaster(...)
+    >>> f.forecasters_  # get individual fitted forecasters
+    {1: NaiveForecaster(), 2: NaiveForecaster(), 3: NaiveForecaster()}
+    >>> fitted_params = f.get_fitted_params()  # or via get_fitted_params
+    >>> y_pred = f.predict()
+
+    Simple example - different parameters per fh element
+    >>> y = load_airline()
+    >>> fh_params = [{}, {"strategy": "last"}, {"strategy": "mean"}]
+    >>> f = FhPlexForecaster(NaiveForecaster(), fh_params=fh_params)
+    >>> f.fit(y, fh=[1, 2, 3])
+    FhPlexForecaster(...)
+    >>> f.forecasters_  # get individual fitted forecasters
+    {1: NaiveForecaster(), 2: NaiveForecaster(), 3: NaiveForecaster(strategy='mean')}
+    >>> y_pred = f.predict()
     """
 
     _tags = {


Test patch:
Repository: sktime/sktime

Issue:
[BUG] `geometric_mean_squared_error` and `geometric_mean_absolute_error` uses undefined keyword argument `sample_weight`
Both of `geometric_mean_squared_error` and `geometric_mean_absolute_error` uses `_weighted_geometric_mean` underneath when `horizon_weight` is passed, these weights are passed to `sample_weight` argument. However, that argument does not exist, and probably `weights` is the indented argument.

**To Reproduce**

```pycon
>>> from sktime.performance_metrics.forecasting import geometric_mean_squared_error
>>> geometric_mean_squared_error([1, 2, 3], [6, 5, 4], horizon_weight=[7, 8, 9])
```

This leads to:

> TypeError: _weighted_geometric_mean() got an unexpected keyword argument 'sample_weight'


Discussion:

Resolving patch:
diff --git a/sktime/performance_metrics/forecasting/_functions.py b/sktime/performance_metrics/forecasting/_functions.py
--- a/sktime/performance_metrics/forecasting/_functions.py
+++ b/sktime/performance_metrics/forecasting/_functions.py
@@ -1302,9 +1302,7 @@ def geometric_mean_absolute_error(
     else:
         check_consistent_length(y_true, horizon_weight)
         output_errors = _weighted_geometric_mean(
-            np.abs(errors),
-            sample_weight=horizon_weight,
-            axis=0,
+            np.abs(errors), weights=horizon_weight, axis=0
         )
 
     if isinstance(multioutput, str):
@@ -1427,9 +1425,7 @@ def geometric_mean_squared_error(
     else:
         check_consistent_length(y_true, horizon_weight)
         output_errors = _weighted_geometric_mean(
-            np.square(errors),
-            sample_weight=horizon_weight,
-            axis=0,
+            np.square(errors), weights=horizon_weight, axis=0
         )
 
     if square_root:


Test patch:
diff --git a/sktime/performance_metrics/forecasting/tests/test_metrics.py b/sktime/performance_metrics/forecasting/tests/test_metrics.py
--- a/sktime/performance_metrics/forecasting/tests/test_metrics.py
+++ b/sktime/performance_metrics/forecasting/tests/test_metrics.py
@@ -62,6 +62,13 @@ def test_gmse_function():
         0.7000014418652152,
     )
 
+    assert np.allclose(
+        gmse(
+            np.array([1, 2, 3]), np.array([6, 5, 4]), horizon_weight=np.array([7, 8, 9])
+        ),
+        6.185891035775025,
+    )
+
 
 def test_linex_class():
     """Doctest from MeanLinexError."""
Repository: sktime/sktime

Issue:
[DOC] Add a copy button to the documentation to help copy pasting the documented examples
Currently, all the documented examples need to be manually copied by the users to try for their own. Adding a `copy` button can simplify this task for user convenience. [This](https://github.com/executablebooks/sphinx-copybutton) extension should be able to add this.

Steps required:

- add new `docs` dependency in `pyproject.toml`
- add to list of extensions in `conf.py`
- configure as per [`documentation`](https://sphinx-copybutton.readthedocs.io/en/latest/use.html)


Discussion:
Oooh, this looks nice! Tentatively agree.

Quick question: is this well-maintained and reasonably widely used?
I know it's used by [`pandas`](https://github.com/pandas-dev/pandas/blob/a43c2e4962dc186c472f52922dbecf2f93f98aae/doc/source/conf.py#L58), don't know about general adoption.

I think it's maintained, it's latest release is in this April only. Also given it's an extension to Sphinx, I'd personally not be very bothered if releases are infrequent, as there may not be anything significantly worth modifying given very limited goal.
Well, if `pandas` uses it, I'm happy.
(because that means, even if it lapses temporarily, someone will want to fix it, given the visibility of the pandas docs)
Hello @yarnabrina, I would like to take this one
Sure @MedAmine-SUDO, go for it 👍🏽

Please go through the [contribution guidelines](https://www.sktime.net/en/latest/get_involved/contributing.html). Let us know if you need any help anywhere.

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -47,6 +47,7 @@
     "nbsphinx",  # integrates example notebooks
     "sphinx_gallery.load_style",
     "myst_parser",
+    "sphinx_copybutton",
     "sphinx_design",
     "sphinx_issues",
     "versionwarning.extension",
@@ -448,3 +449,7 @@ def adds(pth):
 # Show warning at top of page
 versionwarning_body_selector = "div.document"
 versionwarning_banner_title = ""
+
+copybutton_prompt_text = r">>> |\.\.\. |\$ "
+copybutton_prompt_is_regexp = True
+copybutton_line_continuation_character = "\\"


Test patch:
Repository: sktime/sktime

Issue:
[DOC] update configurations for `sphinx.ext.intersphinx` extension to use up to date links for latest stable version
As of now, `make docs` leads to the following warnings during documentation building process locally. 

```shell
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
intersphinx inventory has moved: https://matplotlib.org/objects.inv -> https://matplotlib.org/stable/objects.inv
intersphinx inventory has moved: https://docs.scipy.org/doc/scipy/reference/objects.inv -> https://docs.scipy.org/doc/scipy/objects.inv
```

The links in `docs/source/conf.py` in `intersphinx_mapping` should be updated appropriately.

If there are other links to update as well, for example changing from `latest` to `stable` if available, adding a new link, always using python 3 instead of unnecessarily using `sys.version_info`, etc. can be useful.


Discussion:

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -425,11 +425,11 @@ def adds(pth):
 # Example configuration for intersphinx: refer to the Python standard library.
 intersphinx_mapping = {
     "python": (f"https://docs.python.org/{sys.version_info.major}", None),
-    "numpy": ("https://docs.scipy.org/doc/numpy/", None),
-    "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
-    "matplotlib": ("https://matplotlib.org/", None),
+    "numpy": ("https://numpy.org/doc/stable/", None),
+    "scipy": ("https://docs.scipy.org/doc/scipy/", None),
+    "matplotlib": ("https://matplotlib.org/stable/", None),
     "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
-    "joblib": ("https://joblib.readthedocs.io/en/latest/", None),
+    "joblib": ("https://joblib.readthedocs.io/en/stable/", None),
     "scikit-learn": ("https://scikit-learn.org/stable/", None),
     "statsmodels": ("https://www.statsmodels.org/stable/", None),
 }


Test patch: