Repository: sktime/sktime

Issue:
[BUG] `BaseRegressor.score` method fails with `sklearn.metrics r2_score got an unexpected keyword argument 'normalize'`
**Describe the bug**
When using ResNetRegressor score (also tested with FCNRegressor and same bug) you got a sklearn.metrics error.

TypeError: got an unexpected keyword argument 'normalize'

**To Reproduce**
```python
import sktime
from sktime.regression.deep_learning.resnet import ResNetRegressor
from sktime.datasets import load_UCR_UEA_dataset

data = 'BIDMC32HR'
train_x, train_y = load_UCR_UEA_dataset(name=data, split="train")
test_x,  test_y  = load_UCR_UEA_dataset(name=data, split="test")

model = ResNetRegressor(n_epochs=1, batch_size=1)
model.fit(train_x, train_y)
model.score(test_x, test_y)
```

**Expected behavior**
Not an error but score

**Additional context**

ResNetRegressor::score
<details>

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[7], line 1
----> 1 model.score(test_x, test_y)

File [~/Development/sktime-dev/sktime/sktime/regression/base.py:302](http://localhost:18888/lab/tree/sktime/sktime/sktime/regression/base.py#line=301), in BaseRegressor.score(self, X, y, multioutput)
    298 from sklearn.metrics import r2_score
    300 self.check_is_fitted()
--> 302 return r2_score(y, self.predict(X), normalize=True, multioutput=multioutput)

File [~/Development/sktime-dev/venv/lib/python3.10/site-packages/sklearn/utils/_param_validation.py:191](http://localhost:18888/lab/tree/sktime/venv/lib/python3.10/site-packages/sklearn/utils/_param_validation.py#line=190), in validate_params.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
    188 func_sig = signature(func)
    190 # Map *args/**kwargs to the function signature
--> 191 params = func_sig.bind(*args, **kwargs)
    192 params.apply_defaults()
    194 # ignore self/cls and positional/keyword markers

File /usr/lib/python3.10/inspect.py:3186, in Signature.bind(self, *args, **kwargs)
   3181 def bind(self, /, *args, **kwargs):
   3182     """Get a BoundArguments object, that maps the passed `args`
   3183     and `kwargs` to the function's signature.  Raises `TypeError`
   3184     if the passed arguments can not be bound.
   3185     """
-> 3186     return self._bind(args, kwargs)

File /usr/lib/python3.10/inspect.py:3175, in Signature._bind(self, args, kwargs, partial)
   3173         arguments[kwargs_param.name] = kwargs
   3174     else:
-> 3175         raise TypeError(
   3176             'got an unexpected keyword argument {arg!r}'.format(
   3177                 arg=next(iter(kwargs))))
   3179 return self._bound_arguments_cls(self, arguments)

TypeError: got an unexpected keyword argument 'normalize'
```
</details>

FCNRegressor::model
<details>

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[8], line 4
      2 model = FCNRegressor(n_epochs=1, batch_size=1)
      3 model.fit(train_x, train_y)
----> 4 model.score(test_x, test_y)

File [~/Development/sktime-dev/sktime/sktime/regression/base.py:302](http://localhost:18888/lab/tree/sktime/sktime/sktime/regression/base.py#line=301), in BaseRegressor.score(self, X, y, multioutput)
    298 from sklearn.metrics import r2_score
    300 self.check_is_fitted()
--> 302 return r2_score(y, self.predict(X), normalize=True, multioutput=multioutput)

File [~/Development/sktime-dev/venv/lib/python3.10/site-packages/sklearn/utils/_param_validation.py:191](http://localhost:18888/lab/tree/sktime/venv/lib/python3.10/site-packages/sklearn/utils/_param_validation.py#line=190), in validate_params.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
    188 func_sig = signature(func)
    190 # Map *args/**kwargs to the function signature
--> 191 params = func_sig.bind(*args, **kwargs)
    192 params.apply_defaults()
    194 # ignore self/cls and positional/keyword markers

File /usr/lib/python3.10/inspect.py:3186, in Signature.bind(self, *args, **kwargs)
   3181 def bind(self, /, *args, **kwargs):
   3182     """Get a BoundArguments object, that maps the passed `args`
   3183     and `kwargs` to the function's signature.  Raises `TypeError`
   3184     if the passed arguments can not be bound.
   3185     """
-> 3186     return self._bind(args, kwargs)

File /usr/lib/python3.10/inspect.py:3175, in Signature._bind(self, args, kwargs, partial)
   3173         arguments[kwargs_param.name] = kwargs
   3174     else:
-> 3175         raise TypeError(
   3176             'got an unexpected keyword argument {arg!r}'.format(
   3177                 arg=next(iter(kwargs))))
   3179 return self._bound_arguments_cls(self, arguments)

TypeError: got an unexpected keyword argument 'normalize'
```
</details>

**Versions**
<details>

```
/home/cyril/Development/sktime-dev/venv/lib/python3.10/site-packages/_distutils_hack/__init__.py:26: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
/home/cyril/Development/sktime-dev/venv/lib/python3.10/site-packages/statsforecast/core.py:26: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from tqdm.autonotebook import tqdm
```
System:
    python: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
executable: /home/cyril/Development/sktime-dev/venv/bin/python
   machine: Linux-6.5.0-14-generic-x86_64-with-glibc2.35

Python dependencies:
          pip: 24.0
       sktime: 0.26.1
      sklearn: 1.4.1.post1
       skbase: 0.7.2
        numpy: 1.26.4
        scipy: 1.12.0
       pandas: 2.1.4
   matplotlib: 3.8.3
       joblib: 1.3.2
        numba: 0.58.1
  statsmodels: 0.14.1
     pmdarima: 2.0.4
statsforecast: 1.7.3
      tsfresh: 0.20.2
      tslearn: 0.6.3
        torch: None
   tensorflow: 2.15.0
tensorflow_probability: None
</details>

<!-- Thanks for contributing! -->



Discussion:
The problem came from `sktime.regression.base` `BaseRegressor` class.
This specific methods : 
```
def score(self, X, y, multioutput="uniform_average") -> float:
  from sklearn.metrics import r2_score
  self.check_is_fitted()
  return r2_score(y, self.predict(X), normalize=True, multioutput=multioutput)
```
Specify a `normalize` parameter that I could not find in any scikit-learn documentation.
My theory is that `sktime.regression.base` `BaseRegressor` class is based on `sktime.classification.base` `BaseClassifier`.
The `score` method in this class use `sklearn.metrics` `accuracy_score` which have a `normalize` parameter.

Resolving patch:
diff --git a/sktime/regression/base.py b/sktime/regression/base.py
--- a/sktime/regression/base.py
+++ b/sktime/regression/base.py
@@ -299,7 +299,7 @@ def score(self, X, y, multioutput="uniform_average") -> float:
 
         self.check_is_fitted()
 
-        return r2_score(y, self.predict(X), normalize=True, multioutput=multioutput)
+        return r2_score(y, self.predict(X), multioutput=multioutput)
 
     def _fit(self, X, y):
         """Fit time series regressor to training data.


Test patch:
diff --git a/sktime/regression/tests/test_all_regressors.py b/sktime/regression/tests/test_all_regressors.py
--- a/sktime/regression/tests/test_all_regressors.py
+++ b/sktime/regression/tests/test_all_regressors.py
@@ -77,6 +77,9 @@ def test_regressor_output(self, estimator_instance, scenario):
 
         # run fit and predict
         y_pred = scenario.run(estimator_instance, method_sequence=["fit", "predict"])
+        # check score
+        score = estimator_instance.score(X_new, y_pred)
+        assert np.issubdtype(score.dtype, np.floating)
 
         # check predict
         assert isinstance(y_pred, np.ndarray)
@@ -95,6 +98,9 @@ def test_multioutput(self, estimator_instance):
 
         estimator_instance.fit(X, y_mult)
         y_pred = estimator_instance.predict(X)
+        # check score
+        score = estimator_instance.score(X, y_mult)
+        assert np.issubdtype(score.dtype, np.floating)
 
         assert isinstance(y_pred, pd.DataFrame)
         assert y_pred.shape == y_mult.shape