Repository: sktime/sktime

Issue:
[DOC] in `ForecastingGridSearchCV` and forecaster tuner docstrings, improve description of `scoring` parameter
#### In ForecastingGridSearchCV, it is not well specified what the scoring attribute possible values are...

For example:

gscv = ForecastingGridSearchCV(
    forecaster=pipe_x,
    param_grid=[{
        "forecaster__forecaster__estimator__n_components": [1,2,3,4]
    }
    ],
    cv=cv,
    n_jobs=-1,
    scoring="neg_mean_absolute_error")

TypeError: scoring parameter of ForecastingGridSearchCV must be an sktime metric, descendant ofBaseMetric, or a callable with signature (y_true: 1D np.ndarray, y_pred: 1D np.ndarray) -> float, assuming np.ndarrays being of the same length, and lower being better.

#### ...descendant ofBaseMetric, or a callable with signature should be more specific, as I cannot find where descendants ofBaseMetric are...




Discussion:
I see, let me add that.

Resolving patch:
diff --git a/sktime/forecasting/model_selection/_tune.py b/sktime/forecasting/model_selection/_tune.py
--- a/sktime/forecasting/model_selection/_tune.py
+++ b/sktime/forecasting/model_selection/_tune.py
@@ -376,9 +376,13 @@ class ForecastingGridSearchCV(BaseGridSearch):
         Model tuning parameters of the forecaster to evaluate
     scoring : sktime metric object (BaseMetric), or callable, optional (default=None)
         scoring metric to use in tuning the forecaster
-        if callable, must have signature
+        If callable, must have signature
         `(y_true: 1D np.ndarray, y_pred: 1D np.ndarray) -> float`,
         assuming np.ndarrays being of the same length, and lower being better.
+        Metrics in sktime.performance_metrics.forecasting are all of this form.
+        sktime metric objects (BaseMetric) descendants can be searched
+        with the ``registry.all_estimators`` search utility,
+        for instance via ``all_estimators("metric", as_dataframe=True)``
     n_jobs: int, optional (default=None)
         Number of jobs to run in parallel.
         None means 1 unless in a joblib.parallel_backend context.
@@ -633,9 +637,13 @@ class ForecastingRandomizedSearchCV(BaseGridSearch):
         off runtime vs quality of the solution.
     scoring : sktime metric object (BaseMetric), or callable, optional (default=None)
         scoring metric to use in tuning the forecaster
-        if callable, must have signature
+        If callable, must have signature
         `(y_true: 1D np.ndarray, y_pred: 1D np.ndarray) -> float`,
         assuming np.ndarrays being of the same length, and lower being better.
+        Metrics in sktime.performance_metrics.forecasting are all of this form.
+        sktime metric objects (BaseMetric) descendants can be searched
+        with the ``registry.all_estimators`` search utility,
+        for instance via ``all_estimators("metric", as_dataframe=True)``
     n_jobs : int, optional (default=None)
         Number of jobs to run in parallel.
         None means 1 unless in a joblib.parallel_backend context.
@@ -800,9 +808,13 @@ class ForecastingSkoptSearchCV(BaseGridSearch):
         If this does not align with n_iter, the last iteration will sample less points
     scoring : sktime metric object (BaseMetric), or callable, optional (default=None)
         scoring metric to use in tuning the forecaster
-        if callable, must have signature
+        If callable, must have signature
         `(y_true: 1D np.ndarray, y_pred: 1D np.ndarray) -> float`,
         assuming np.ndarrays being of the same length, and lower being better.
+        Metrics in sktime.performance_metrics.forecasting are all of this form.
+        sktime metric objects (BaseMetric) descendants can be searched
+        with the ``registry.all_estimators`` search utility,
+        for instance via ``all_estimators("metric", as_dataframe=True)``
     optimizer_kwargs: dict, optional
         Arguments passed to Optimizer to control the bahaviour of the bayesian search.
         For example, {'base_estimator': 'RF'} would use a Random Forest surrogate


Test patch: