Repository: sktime/sktime

Issue:
[BUG] Forecasting horizon in score method
**Describe the bug**
The following code fails when no forecasting horizon is provided to compute score.

**To Reproduce**
```python
from sktime.forecasters import ExpSmoothingForecaster
from sktime.datasets import load_shampoo_sales

import pandas as pd


shampoo = load_shampoo_sales()

# split data into train, update and test
train = pd.Series([shampoo.iloc[0].iloc[:30]])
test = pd.Series([shampoo.iloc[0].iloc[30:]])

# simple exponential smoothing
m = ExpSmoothingForecaster()
m.fit(train)
m.score(test)
```

**Expected behavior**
Code should return a score

**Additional context**
Remove `None` as default fh

**Versions**
<details>

Darwin-18.6.0-x86_64-i386-64bit
Python 3.7.4 (default, Aug  5 2019, 21:56:28) 
[Clang 10.0.1 (clang-1001.0.46.4)]
NumPy 1.17.2
SciPy 1.3.1
sktime 0.3.0

</details>

<!-- Thanks for contributing! -->



Discussion:
Thanks for reporting the bug! I believe this has been fixed already (see #126) but isn't in the latest release yet. 
Hello @mloning,

I've already seen this PR. Tell me if I'm wrong, but it seems to me that the issue was fixed for `fit`and `predict` methods, but not `score`.
Also I left out than I ran my tests on the dev branch.

Yes, you're right, thanks! Will add this via the forecasting branch, unless you want to make a PR?

Resolving patch:
diff --git a/sktime/forecasters/base.py b/sktime/forecasters/base.py
--- a/sktime/forecasters/base.py
+++ b/sktime/forecasters/base.py
@@ -39,7 +39,7 @@ def fit(self, y, fh=1, X=None):
         ----------
         y : pandas.Series
             Target time series to which to fit the forecaster.
-        fh : array-like, optional (default=None)
+        fh : int or array-like, optional (default=1)
             The forecasters horizon with the steps ahead to to predict. Default is one-step ahead forecast,
             i.e. np.array([1])
         X : pandas.DataFrame, shape=[n_obs, n_vars], optional (default=None)
@@ -77,7 +77,7 @@ def predict(self, fh=1, X=None):
 
         Parameters
         ----------
-        fh : array-like, optional (default=None)
+        fh : int or array-like, optional (default=1)
             The forecasters horizon with the steps ahead to to predict. Default is one-step ahead forecast,
             i.e. np.array([1])
         X : pandas.DataFrame, shape=[n_obs, n_vars], optional (default=None)
@@ -115,7 +115,7 @@ def score(self, y, fh=None, X=None, sample_weight=None):
         ----------
         y : pandas.Series
             Target time series to which to fit the forecaster.
-        fh : array-like, optional (default=[1])
+        fh : int or array-like, optional (default=None)
             The forecasters horizon with the steps ahead to to predict.
         X : pandas.DataFrame, shape=[n_obs, n_vars], optional (default=None)
             An optional 2-d dataframe of exogenous variables. If provided, these
@@ -135,6 +135,10 @@ def score(self, y, fh=None, X=None, sample_weight=None):
         if self.check_input:
             validate_y(y)
 
+        # Set fh if not provided
+        if fh is None:
+            fh = np.arange(1, len(y.iloc[0]) + 1)
+
         # Predict y_pred
         # pass exogenous variable to predict only if given, as some forecasters may not accept X in predict
         kwargs = {} if X is None else {'X': X}
@@ -269,7 +273,7 @@ def _predict(self, fh=None):
 
         Parameters
         ----------
-        fh : array-like, optional (default=None)
+        fh : int or array-like, optional (default=1)
             The forecasters horizon with the steps ahead to to predict. Default is one-step ahead forecast,
             i.e. np.array([1])
 


Test patch:
diff --git a/sktime/forecasters/tests/test_forecasters.py b/sktime/forecasters/tests/test_forecasters.py
--- a/sktime/forecasters/tests/test_forecasters.py
+++ b/sktime/forecasters/tests/test_forecasters.py
@@ -63,8 +63,7 @@ def test_set_params(forecaster, params):
 
 @pytest.mark.filterwarnings('ignore::FutureWarning')
 @pytest.mark.parametrize("forecaster", FORECASTERS)
-@pytest.mark.parametrize("fh", FHS)
-def test_score(forecaster, fh):
+def test_score(forecaster):
     m = forecaster()
     train = pd.Series([y.iloc[0].iloc[:30]])
     test = pd.Series([y.iloc[0].iloc[30:]])