We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] Prophet adapter fails to clone after setting parameters
**Describe the bug**
<!--
A clear and concise description of what the bug is.
-->

Using sklearn's `clone` on `Prophet` after either `seasonality_prior_scale`, `changepoint_prior_scale` or `holidays_prior_scale` were set with a non-float value through `set_params` will raise a `RuntimeError` during cloning. This is due to the `float` conversion happening in `__init__`, which is against what sklearn expects during cloning - it expects that all of the values passed as arguments to `__init__` will not be modified in any way when being set as object attributes.

**To Reproduce**
<!--
Add a Minimal, Complete, and Verifiable example (for more details, see e.g. https://stackoverflow.com/help/mcve

If the code is too long, feel free to put it in a public gist and link it in the issue: https://gist.github.com
-->

```python
from sktime.forecasting.fbprophet import Prophet
from sklearn.base import clone
model = Prophet()
model.set_params(changepoint_prior_scale=1)
clone(model)
```

This will raise a sklearn `RuntimeError`.

**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->

No exception is raised.

**Additional context**
<!--
Add any other context about the problem here.
-->

**Versions**
<details>

<!--
Please run the following code snippet and paste the output here:
 
from sktime import show_versions; show_versions()
-->
```
System:
    python: 3.8.5 (default, Sep  4 2020, 07:30:14)  [GCC 7.3.0]
executable: /home/baum/anaconda3/bin/python
   machine: Linux-5.11.0-7614-generic-x86_64-with-glibc2.10

Python dependencies:
          pip: 20.2.4
   setuptools: 50.3.1.post20201107
      sklearn: 0.23.2
       sktime: 0.5.3
  statsmodels: 0.12.2
        numpy: 1.20.1
        scipy: 1.6.1
       Cython: 0.29.17
       pandas: 1.2.3
   matplotlib: 3.4.1
       joblib: 1.0.1
        numba: 0.51.2
     pmdarima: 1.8.0
      tsfresh: None
```
</details>

<!-- Thanks for contributing! -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sktime/forecasting/fbprophet.py`
Content:
```
1 #!/usr/bin/env python3 -u
2 # -*- coding: utf-8 -*-
3 # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
4 
5 __author__ = ["Martin Walter"]
6 __all__ = ["Prophet"]
7 
8 from sktime.forecasting.base._base import DEFAULT_ALPHA
9 from sktime.forecasting.base.adapters import _ProphetAdapter
10 from sktime.utils.validation._dependencies import _check_soft_dependencies
11 
12 _check_soft_dependencies("fbprophet")
13 
14 
15 class Prophet(_ProphetAdapter):
16     """Prophet forecaster by wrapping fbprophet.
17     Parameters
18     ----------
19     freq: String of DatetimeIndex frequency. See here for possible values:
20         https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
21         #timeseries-offset-aliases
22     add_seasonality: Dict with args for Prophet.add_seasonality().
23         Dict can have the following keys/values:
24             name: string name of the seasonality component.
25             period: float number of days in one period.
26             fourier_order: int number of Fourier components to use.
27             prior_scale: optional float prior scale for this component.
28             mode: optional 'additive' or 'multiplicative'
29             condition_name: string name of the seasonality condition.
30     add_country_holidays: Dict with args for Prophet.add_country_holidays().
31         Dict can have the following keys/values:
32             country_name: Name of the country, like 'UnitedStates' or 'US'
33     growth: String 'linear' or 'logistic' to specify a linear or logistic
34         trend.
35     changepoints: List of dates at which to include potential changepoints. If
36         not specified, potential changepoints are selected automatically.
37     n_changepoints: Number of potential changepoints to include. Not used
38         if input `changepoints` is supplied. If `changepoints` is not supplied,
39         then n_changepoints potential changepoints are selected uniformly from
40         the first `changepoint_range` proportion of the history.
41     changepoint_range: Proportion of history in which trend changepoints will
42         be estimated. Defaults to 0.8 for the first 80%. Not used if
43         `changepoints` is specified.
44     yearly_seasonality: Fit yearly seasonality.
45         Can be 'auto', True, False, or a number of Fourier terms to generate.
46     weekly_seasonality: Fit weekly seasonality.
47         Can be 'auto', True, False, or a number of Fourier terms to generate.
48     daily_seasonality: Fit daily seasonality.
49         Can be 'auto', True, False, or a number of Fourier terms to generate.
50     holidays: pd.DataFrame with columns holiday (string) and ds (date type)
51         and optionally columns lower_window and upper_window which specify a
52         range of days around the date to be included as holidays.
53         lower_window=-2 will include 2 days prior to the date as holidays. Also
54         optionally can have a column prior_scale specifying the prior scale for
55         that holiday.
56     seasonality_mode: 'additive' (default) or 'multiplicative'.
57     seasonality_prior_scale: Parameter modulating the strength of the
58         seasonality model. Larger values allow the model to fit larger seasonal
59         fluctuations, smaller values dampen the seasonality. Can be specified
60         for individual seasonalities using add_seasonality.
61     holidays_prior_scale: Parameter modulating the strength of the holiday
62         components model, unless overridden in the holidays input.
63     changepoint_prior_scale: Parameter modulating the flexibility of the
64         automatic changepoint selection. Large values will allow many
65         changepoints, small values will allow few changepoints.
66     mcmc_samples: Integer, if greater than 0, will do full Bayesian inference
67         with the specified number of MCMC samples. If 0, will do MAP
68         estimation.
69     alpha: Float, width of the uncertainty intervals provided
70         for the forecast. If mcmc_samples=0, this will be only the uncertainty
71         in the trend using the MAP estimate of the extrapolated generative
72         model. If mcmc.samples>0, this will be integrated over all model
73         parameters, which will include uncertainty in seasonality.
74     uncertainty_samples: Number of simulated draws used to estimate
75         uncertainty intervals. Settings this value to 0 or False will disable
76         uncertainty estimation and speed up the calculation.
77     stan_backend: str as defined in StanBackendEnum default: None - will try to
78         iterate over all available backends and find the working one
79 
80     References
81     ----------
82     https://facebook.github.io/prophet
83     https://github.com/facebook/prophet
84 
85     Example
86     ----------
87     >>> from sktime.datasets import load_airline
88     >>> from sktime.forecasting.fbprophet import Prophet
89     >>> # Prophet requires to have data with a pandas.DatetimeIndex
90     >>> y = load_airline().to_timestamp(freq='M')
91     >>> forecaster = Prophet(
92     ...     seasonality_mode='multiplicative',
93     ...     n_changepoints=int(len(y) / 12),
94     ...     add_country_holidays={'country_name': 'Germany'},
95     ...     yearly_seasonality=True)
96     >>> forecaster.fit(y)
97     Prophet(...)
98     >>> y_pred = forecaster.predict(fh=[1,2,3])
99     """
100 
101     def __init__(
102         self,
103         # Args due to wrapping
104         freq=None,
105         add_seasonality=None,
106         add_country_holidays=None,
107         # Args of fbprophet
108         growth="linear",
109         changepoints=None,
110         n_changepoints=25,
111         changepoint_range=0.8,
112         yearly_seasonality="auto",
113         weekly_seasonality="auto",
114         daily_seasonality="auto",
115         holidays=None,
116         seasonality_mode="additive",
117         seasonality_prior_scale=10.0,
118         holidays_prior_scale=10.0,
119         changepoint_prior_scale=0.05,
120         mcmc_samples=0,
121         alpha=DEFAULT_ALPHA,
122         uncertainty_samples=1000,
123         stan_backend=None,
124         verbose=0,
125     ):
126         self.freq = freq
127         self.add_seasonality = add_seasonality
128         self.add_country_holidays = add_country_holidays
129 
130         self.growth = growth
131         self.changepoints = changepoints
132         self.n_changepoints = n_changepoints
133         self.changepoint_range = changepoint_range
134         self.yearly_seasonality = yearly_seasonality
135         self.weekly_seasonality = weekly_seasonality
136         self.daily_seasonality = daily_seasonality
137         self.holidays = holidays
138         self.seasonality_mode = seasonality_mode
139         self.seasonality_prior_scale = float(seasonality_prior_scale)
140         self.changepoint_prior_scale = float(changepoint_prior_scale)
141         self.holidays_prior_scale = float(holidays_prior_scale)
142         self.mcmc_samples = mcmc_samples
143         self.alpha = alpha
144         self.uncertainty_samples = uncertainty_samples
145         self.stan_backend = stan_backend
146         self.verbose = verbose
147 
148         # import inside method to avoid hard dependency
149         from fbprophet.forecaster import Prophet as _Prophet
150 
151         self._ModelClass = _Prophet
152 
153         super(Prophet, self).__init__()
154 
155     def _instantiate_model(self):
156         self._forecaster = self._ModelClass(
157             growth=self.growth,
158             changepoints=self.changepoints,
159             n_changepoints=self.n_changepoints,
160             changepoint_range=self.changepoint_range,
161             yearly_seasonality=self.yearly_seasonality,
162             weekly_seasonality=self.weekly_seasonality,
163             daily_seasonality=self.daily_seasonality,
164             holidays=self.holidays,
165             seasonality_mode=self.seasonality_mode,
166             seasonality_prior_scale=self.seasonality_prior_scale,
167             holidays_prior_scale=self.holidays_prior_scale,
168             changepoint_prior_scale=self.changepoint_prior_scale,
169             mcmc_samples=self.mcmc_samples,
170             interval_width=1 - self.alpha,
171             uncertainty_samples=self.uncertainty_samples,
172             stan_backend=self.stan_backend,
173         )
174         return self
175
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sktime/forecasting/fbprophet.py b/sktime/forecasting/fbprophet.py
--- a/sktime/forecasting/fbprophet.py
+++ b/sktime/forecasting/fbprophet.py
@@ -2,6 +2,8 @@
 # -*- coding: utf-8 -*-
 # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
 
+"""Prophet forecaster by wrapping fbprophet."""
+
 __author__ = ["Martin Walter"]
 __all__ = ["Prophet"]
 
@@ -14,6 +16,7 @@
 
 class Prophet(_ProphetAdapter):
     """Prophet forecaster by wrapping fbprophet.
+
     Parameters
     ----------
     freq: String of DatetimeIndex frequency. See here for possible values:
@@ -136,9 +139,9 @@
         self.daily_seasonality = daily_seasonality
         self.holidays = holidays
         self.seasonality_mode = seasonality_mode
-        self.seasonality_prior_scale = float(seasonality_prior_scale)
-        self.changepoint_prior_scale = float(changepoint_prior_scale)
-        self.holidays_prior_scale = float(holidays_prior_scale)
+        self.seasonality_prior_scale = seasonality_prior_scale
+        self.changepoint_prior_scale = changepoint_prior_scale
+        self.holidays_prior_scale = holidays_prior_scale
         self.mcmc_samples = mcmc_samples
         self.alpha = alpha
         self.uncertainty_samples = uncertainty_samples
@@ -163,9 +166,9 @@
             daily_seasonality=self.daily_seasonality,
             holidays=self.holidays,
             seasonality_mode=self.seasonality_mode,
-            seasonality_prior_scale=self.seasonality_prior_scale,
-            holidays_prior_scale=self.holidays_prior_scale,
-            changepoint_prior_scale=self.changepoint_prior_scale,
+            seasonality_prior_scale=float(self.seasonality_prior_scale),
+            holidays_prior_scale=float(self.holidays_prior_scale),
+            changepoint_prior_scale=float(self.changepoint_prior_scale),
             mcmc_samples=self.mcmc_samples,
             interval_width=1 - self.alpha,
             uncertainty_samples=self.uncertainty_samples,

{"golden_diff": "diff --git a/sktime/forecasting/fbprophet.py b/sktime/forecasting/fbprophet.py\n--- a/sktime/forecasting/fbprophet.py\n+++ b/sktime/forecasting/fbprophet.py\n@@ -2,6 +2,8 @@\n # -*- coding: utf-8 -*-\n # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n \n+\"\"\"Prophet forecaster by wrapping fbprophet.\"\"\"\n+\n __author__ = [\"Martin Walter\"]\n __all__ = [\"Prophet\"]\n \n@@ -14,6 +16,7 @@\n \n class Prophet(_ProphetAdapter):\n     \"\"\"Prophet forecaster by wrapping fbprophet.\n+\n     Parameters\n     ----------\n     freq: String of DatetimeIndex frequency. See here for possible values:\n@@ -136,9 +139,9 @@\n         self.daily_seasonality = daily_seasonality\n         self.holidays = holidays\n         self.seasonality_mode = seasonality_mode\n-        self.seasonality_prior_scale = float(seasonality_prior_scale)\n-        self.changepoint_prior_scale = float(changepoint_prior_scale)\n-        self.holidays_prior_scale = float(holidays_prior_scale)\n+        self.seasonality_prior_scale = seasonality_prior_scale\n+        self.changepoint_prior_scale = changepoint_prior_scale\n+        self.holidays_prior_scale = holidays_prior_scale\n         self.mcmc_samples = mcmc_samples\n         self.alpha = alpha\n         self.uncertainty_samples = uncertainty_samples\n@@ -163,9 +166,9 @@\n             daily_seasonality=self.daily_seasonality,\n             holidays=self.holidays,\n             seasonality_mode=self.seasonality_mode,\n-            seasonality_prior_scale=self.seasonality_prior_scale,\n-            holidays_prior_scale=self.holidays_prior_scale,\n-            changepoint_prior_scale=self.changepoint_prior_scale,\n+            seasonality_prior_scale=float(self.seasonality_prior_scale),\n+            holidays_prior_scale=float(self.holidays_prior_scale),\n+            changepoint_prior_scale=float(self.changepoint_prior_scale),\n             mcmc_samples=self.mcmc_samples,\n             interval_width=1 - self.alpha,\n             uncertainty_samples=self.uncertainty_samples,\n", "issue": "[BUG] Prophet adapter fails to clone after setting parameters\n**Describe the bug**\r\n<!--\r\nA clear and concise description of what the bug is.\r\n-->\r\n\r\nUsing sklearn's `clone` on `Prophet` after either `seasonality_prior_scale`, `changepoint_prior_scale` or `holidays_prior_scale` were set with a non-float value through `set_params` will raise a `RuntimeError` during cloning. This is due to the `float` conversion happening in `__init__`, which is against what sklearn expects during cloning - it expects that all of the values passed as arguments to `__init__` will not be modified in any way when being set as object attributes.\r\n\r\n**To Reproduce**\r\n<!--\r\nAdd a Minimal, Complete, and Verifiable example (for more details, see e.g. https://stackoverflow.com/help/mcve\r\n\r\nIf the code is too long, feel free to put it in a public gist and link it in the issue: https://gist.github.com\r\n-->\r\n\r\n```python\r\nfrom sktime.forecasting.fbprophet import Prophet\r\nfrom sklearn.base import clone\r\nmodel = Prophet()\r\nmodel.set_params(changepoint_prior_scale=1)\r\nclone(model)\r\n```\r\n\r\nThis will raise a sklearn `RuntimeError`.\r\n\r\n**Expected behavior**\r\n<!--\r\nA clear and concise description of what you expected to happen.\r\n-->\r\n\r\nNo exception is raised.\r\n\r\n**Additional context**\r\n<!--\r\nAdd any other context about the problem here.\r\n-->\r\n\r\n**Versions**\r\n<details>\r\n\r\n<!--\r\nPlease run the following code snippet and paste the output here:\r\n \r\nfrom sktime import show_versions; show_versions()\r\n-->\r\n```\r\nSystem:\r\n    python: 3.8.5 (default, Sep  4 2020, 07:30:14)  [GCC 7.3.0]\r\nexecutable: /home/baum/anaconda3/bin/python\r\n   machine: Linux-5.11.0-7614-generic-x86_64-with-glibc2.10\r\n\r\nPython dependencies:\r\n          pip: 20.2.4\r\n   setuptools: 50.3.1.post20201107\r\n      sklearn: 0.23.2\r\n       sktime: 0.5.3\r\n  statsmodels: 0.12.2\r\n        numpy: 1.20.1\r\n        scipy: 1.6.1\r\n       Cython: 0.29.17\r\n       pandas: 1.2.3\r\n   matplotlib: 3.4.1\r\n       joblib: 1.0.1\r\n        numba: 0.51.2\r\n     pmdarima: 1.8.0\r\n      tsfresh: None\r\n```\r\n</details>\r\n\r\n<!-- Thanks for contributing! -->\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3 -u\n# -*- coding: utf-8 -*-\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n\n__author__ = [\"Martin Walter\"]\n__all__ = [\"Prophet\"]\n\nfrom sktime.forecasting.base._base import DEFAULT_ALPHA\nfrom sktime.forecasting.base.adapters import _ProphetAdapter\nfrom sktime.utils.validation._dependencies import _check_soft_dependencies\n\n_check_soft_dependencies(\"fbprophet\")\n\n\nclass Prophet(_ProphetAdapter):\n    \"\"\"Prophet forecaster by wrapping fbprophet.\n    Parameters\n    ----------\n    freq: String of DatetimeIndex frequency. See here for possible values:\n        https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html\n        #timeseries-offset-aliases\n    add_seasonality: Dict with args for Prophet.add_seasonality().\n        Dict can have the following keys/values:\n            name: string name of the seasonality component.\n            period: float number of days in one period.\n            fourier_order: int number of Fourier components to use.\n            prior_scale: optional float prior scale for this component.\n            mode: optional 'additive' or 'multiplicative'\n            condition_name: string name of the seasonality condition.\n    add_country_holidays: Dict with args for Prophet.add_country_holidays().\n        Dict can have the following keys/values:\n            country_name: Name of the country, like 'UnitedStates' or 'US'\n    growth: String 'linear' or 'logistic' to specify a linear or logistic\n        trend.\n    changepoints: List of dates at which to include potential changepoints. If\n        not specified, potential changepoints are selected automatically.\n    n_changepoints: Number of potential changepoints to include. Not used\n        if input `changepoints` is supplied. If `changepoints` is not supplied,\n        then n_changepoints potential changepoints are selected uniformly from\n        the first `changepoint_range` proportion of the history.\n    changepoint_range: Proportion of history in which trend changepoints will\n        be estimated. Defaults to 0.8 for the first 80%. Not used if\n        `changepoints` is specified.\n    yearly_seasonality: Fit yearly seasonality.\n        Can be 'auto', True, False, or a number of Fourier terms to generate.\n    weekly_seasonality: Fit weekly seasonality.\n        Can be 'auto', True, False, or a number of Fourier terms to generate.\n    daily_seasonality: Fit daily seasonality.\n        Can be 'auto', True, False, or a number of Fourier terms to generate.\n    holidays: pd.DataFrame with columns holiday (string) and ds (date type)\n        and optionally columns lower_window and upper_window which specify a\n        range of days around the date to be included as holidays.\n        lower_window=-2 will include 2 days prior to the date as holidays. Also\n        optionally can have a column prior_scale specifying the prior scale for\n        that holiday.\n    seasonality_mode: 'additive' (default) or 'multiplicative'.\n    seasonality_prior_scale: Parameter modulating the strength of the\n        seasonality model. Larger values allow the model to fit larger seasonal\n        fluctuations, smaller values dampen the seasonality. Can be specified\n        for individual seasonalities using add_seasonality.\n    holidays_prior_scale: Parameter modulating the strength of the holiday\n        components model, unless overridden in the holidays input.\n    changepoint_prior_scale: Parameter modulating the flexibility of the\n        automatic changepoint selection. Large values will allow many\n        changepoints, small values will allow few changepoints.\n    mcmc_samples: Integer, if greater than 0, will do full Bayesian inference\n        with the specified number of MCMC samples. If 0, will do MAP\n        estimation.\n    alpha: Float, width of the uncertainty intervals provided\n        for the forecast. If mcmc_samples=0, this will be only the uncertainty\n        in the trend using the MAP estimate of the extrapolated generative\n        model. If mcmc.samples>0, this will be integrated over all model\n        parameters, which will include uncertainty in seasonality.\n    uncertainty_samples: Number of simulated draws used to estimate\n        uncertainty intervals. Settings this value to 0 or False will disable\n        uncertainty estimation and speed up the calculation.\n    stan_backend: str as defined in StanBackendEnum default: None - will try to\n        iterate over all available backends and find the working one\n\n    References\n    ----------\n    https://facebook.github.io/prophet\n    https://github.com/facebook/prophet\n\n    Example\n    ----------\n    >>> from sktime.datasets import load_airline\n    >>> from sktime.forecasting.fbprophet import Prophet\n    >>> # Prophet requires to have data with a pandas.DatetimeIndex\n    >>> y = load_airline().to_timestamp(freq='M')\n    >>> forecaster = Prophet(\n    ...     seasonality_mode='multiplicative',\n    ...     n_changepoints=int(len(y) / 12),\n    ...     add_country_holidays={'country_name': 'Germany'},\n    ...     yearly_seasonality=True)\n    >>> forecaster.fit(y)\n    Prophet(...)\n    >>> y_pred = forecaster.predict(fh=[1,2,3])\n    \"\"\"\n\n    def __init__(\n        self,\n        # Args due to wrapping\n        freq=None,\n        add_seasonality=None,\n        add_country_holidays=None,\n        # Args of fbprophet\n        growth=\"linear\",\n        changepoints=None,\n        n_changepoints=25,\n        changepoint_range=0.8,\n        yearly_seasonality=\"auto\",\n        weekly_seasonality=\"auto\",\n        daily_seasonality=\"auto\",\n        holidays=None,\n        seasonality_mode=\"additive\",\n        seasonality_prior_scale=10.0,\n        holidays_prior_scale=10.0,\n        changepoint_prior_scale=0.05,\n        mcmc_samples=0,\n        alpha=DEFAULT_ALPHA,\n        uncertainty_samples=1000,\n        stan_backend=None,\n        verbose=0,\n    ):\n        self.freq = freq\n        self.add_seasonality = add_seasonality\n        self.add_country_holidays = add_country_holidays\n\n        self.growth = growth\n        self.changepoints = changepoints\n        self.n_changepoints = n_changepoints\n        self.changepoint_range = changepoint_range\n        self.yearly_seasonality = yearly_seasonality\n        self.weekly_seasonality = weekly_seasonality\n        self.daily_seasonality = daily_seasonality\n        self.holidays = holidays\n        self.seasonality_mode = seasonality_mode\n        self.seasonality_prior_scale = float(seasonality_prior_scale)\n        self.changepoint_prior_scale = float(changepoint_prior_scale)\n        self.holidays_prior_scale = float(holidays_prior_scale)\n        self.mcmc_samples = mcmc_samples\n        self.alpha = alpha\n        self.uncertainty_samples = uncertainty_samples\n        self.stan_backend = stan_backend\n        self.verbose = verbose\n\n        # import inside method to avoid hard dependency\n        from fbprophet.forecaster import Prophet as _Prophet\n\n        self._ModelClass = _Prophet\n\n        super(Prophet, self).__init__()\n\n    def _instantiate_model(self):\n        self._forecaster = self._ModelClass(\n            growth=self.growth,\n            changepoints=self.changepoints,\n            n_changepoints=self.n_changepoints,\n            changepoint_range=self.changepoint_range,\n            yearly_seasonality=self.yearly_seasonality,\n            weekly_seasonality=self.weekly_seasonality,\n            daily_seasonality=self.daily_seasonality,\n            holidays=self.holidays,\n            seasonality_mode=self.seasonality_mode,\n            seasonality_prior_scale=self.seasonality_prior_scale,\n            holidays_prior_scale=self.holidays_prior_scale,\n            changepoint_prior_scale=self.changepoint_prior_scale,\n            mcmc_samples=self.mcmc_samples,\n            interval_width=1 - self.alpha,\n            uncertainty_samples=self.uncertainty_samples,\n            stan_backend=self.stan_backend,\n        )\n        return self\n", "path": "sktime/forecasting/fbprophet.py"}], "after_files": [{"content": "#!/usr/bin/env python3 -u\n# -*- coding: utf-8 -*-\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n\n\"\"\"Prophet forecaster by wrapping fbprophet.\"\"\"\n\n__author__ = [\"Martin Walter\"]\n__all__ = [\"Prophet\"]\n\nfrom sktime.forecasting.base._base import DEFAULT_ALPHA\nfrom sktime.forecasting.base.adapters import _ProphetAdapter\nfrom sktime.utils.validation._dependencies import _check_soft_dependencies\n\n_check_soft_dependencies(\"fbprophet\")\n\n\nclass Prophet(_ProphetAdapter):\n    \"\"\"Prophet forecaster by wrapping fbprophet.\n\n    Parameters\n    ----------\n    freq: String of DatetimeIndex frequency. See here for possible values:\n        https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html\n        #timeseries-offset-aliases\n    add_seasonality: Dict with args for Prophet.add_seasonality().\n        Dict can have the following keys/values:\n            name: string name of the seasonality component.\n            period: float number of days in one period.\n            fourier_order: int number of Fourier components to use.\n            prior_scale: optional float prior scale for this component.\n            mode: optional 'additive' or 'multiplicative'\n            condition_name: string name of the seasonality condition.\n    add_country_holidays: Dict with args for Prophet.add_country_holidays().\n        Dict can have the following keys/values:\n            country_name: Name of the country, like 'UnitedStates' or 'US'\n    growth: String 'linear' or 'logistic' to specify a linear or logistic\n        trend.\n    changepoints: List of dates at which to include potential changepoints. If\n        not specified, potential changepoints are selected automatically.\n    n_changepoints: Number of potential changepoints to include. Not used\n        if input `changepoints` is supplied. If `changepoints` is not supplied,\n        then n_changepoints potential changepoints are selected uniformly from\n        the first `changepoint_range` proportion of the history.\n    changepoint_range: Proportion of history in which trend changepoints will\n        be estimated. Defaults to 0.8 for the first 80%. Not used if\n        `changepoints` is specified.\n    yearly_seasonality: Fit yearly seasonality.\n        Can be 'auto', True, False, or a number of Fourier terms to generate.\n    weekly_seasonality: Fit weekly seasonality.\n        Can be 'auto', True, False, or a number of Fourier terms to generate.\n    daily_seasonality: Fit daily seasonality.\n        Can be 'auto', True, False, or a number of Fourier terms to generate.\n    holidays: pd.DataFrame with columns holiday (string) and ds (date type)\n        and optionally columns lower_window and upper_window which specify a\n        range of days around the date to be included as holidays.\n        lower_window=-2 will include 2 days prior to the date as holidays. Also\n        optionally can have a column prior_scale specifying the prior scale for\n        that holiday.\n    seasonality_mode: 'additive' (default) or 'multiplicative'.\n    seasonality_prior_scale: Parameter modulating the strength of the\n        seasonality model. Larger values allow the model to fit larger seasonal\n        fluctuations, smaller values dampen the seasonality. Can be specified\n        for individual seasonalities using add_seasonality.\n    holidays_prior_scale: Parameter modulating the strength of the holiday\n        components model, unless overridden in the holidays input.\n    changepoint_prior_scale: Parameter modulating the flexibility of the\n        automatic changepoint selection. Large values will allow many\n        changepoints, small values will allow few changepoints.\n    mcmc_samples: Integer, if greater than 0, will do full Bayesian inference\n        with the specified number of MCMC samples. If 0, will do MAP\n        estimation.\n    alpha: Float, width of the uncertainty intervals provided\n        for the forecast. If mcmc_samples=0, this will be only the uncertainty\n        in the trend using the MAP estimate of the extrapolated generative\n        model. If mcmc.samples>0, this will be integrated over all model\n        parameters, which will include uncertainty in seasonality.\n    uncertainty_samples: Number of simulated draws used to estimate\n        uncertainty intervals. Settings this value to 0 or False will disable\n        uncertainty estimation and speed up the calculation.\n    stan_backend: str as defined in StanBackendEnum default: None - will try to\n        iterate over all available backends and find the working one\n\n    References\n    ----------\n    https://facebook.github.io/prophet\n    https://github.com/facebook/prophet\n\n    Example\n    ----------\n    >>> from sktime.datasets import load_airline\n    >>> from sktime.forecasting.fbprophet import Prophet\n    >>> # Prophet requires to have data with a pandas.DatetimeIndex\n    >>> y = load_airline().to_timestamp(freq='M')\n    >>> forecaster = Prophet(\n    ...     seasonality_mode='multiplicative',\n    ...     n_changepoints=int(len(y) / 12),\n    ...     add_country_holidays={'country_name': 'Germany'},\n    ...     yearly_seasonality=True)\n    >>> forecaster.fit(y)\n    Prophet(...)\n    >>> y_pred = forecaster.predict(fh=[1,2,3])\n    \"\"\"\n\n    def __init__(\n        self,\n        # Args due to wrapping\n        freq=None,\n        add_seasonality=None,\n        add_country_holidays=None,\n        # Args of fbprophet\n        growth=\"linear\",\n        changepoints=None,\n        n_changepoints=25,\n        changepoint_range=0.8,\n        yearly_seasonality=\"auto\",\n        weekly_seasonality=\"auto\",\n        daily_seasonality=\"auto\",\n        holidays=None,\n        seasonality_mode=\"additive\",\n        seasonality_prior_scale=10.0,\n        holidays_prior_scale=10.0,\n        changepoint_prior_scale=0.05,\n        mcmc_samples=0,\n        alpha=DEFAULT_ALPHA,\n        uncertainty_samples=1000,\n        stan_backend=None,\n        verbose=0,\n    ):\n        self.freq = freq\n        self.add_seasonality = add_seasonality\n        self.add_country_holidays = add_country_holidays\n\n        self.growth = growth\n        self.changepoints = changepoints\n        self.n_changepoints = n_changepoints\n        self.changepoint_range = changepoint_range\n        self.yearly_seasonality = yearly_seasonality\n        self.weekly_seasonality = weekly_seasonality\n        self.daily_seasonality = daily_seasonality\n        self.holidays = holidays\n        self.seasonality_mode = seasonality_mode\n        self.seasonality_prior_scale = seasonality_prior_scale\n        self.changepoint_prior_scale = changepoint_prior_scale\n        self.holidays_prior_scale = holidays_prior_scale\n        self.mcmc_samples = mcmc_samples\n        self.alpha = alpha\n        self.uncertainty_samples = uncertainty_samples\n        self.stan_backend = stan_backend\n        self.verbose = verbose\n\n        # import inside method to avoid hard dependency\n        from fbprophet.forecaster import Prophet as _Prophet\n\n        self._ModelClass = _Prophet\n\n        super(Prophet, self).__init__()\n\n    def _instantiate_model(self):\n        self._forecaster = self._ModelClass(\n            growth=self.growth,\n            changepoints=self.changepoints,\n            n_changepoints=self.n_changepoints,\n            changepoint_range=self.changepoint_range,\n            yearly_seasonality=self.yearly_seasonality,\n            weekly_seasonality=self.weekly_seasonality,\n            daily_seasonality=self.daily_seasonality,\n            holidays=self.holidays,\n            seasonality_mode=self.seasonality_mode,\n            seasonality_prior_scale=float(self.seasonality_prior_scale),\n            holidays_prior_scale=float(self.holidays_prior_scale),\n            changepoint_prior_scale=float(self.changepoint_prior_scale),\n            mcmc_samples=self.mcmc_samples,\n            interval_width=1 - self.alpha,\n            uncertainty_samples=self.uncertainty_samples,\n            stan_backend=self.stan_backend,\n        )\n        return self\n", "path": "sktime/forecasting/fbprophet.py"}]}