linkedin / greykite

A flexible, intuitive and fast forecasting library
BSD 2-Clause "Simplified" License
1.81k stars 106 forks source link

TypeError in docs examples #131

Open eulbdoor opened 10 months ago

eulbdoor commented 10 months ago

Hi there, getting the following error:

[1](vscode-notebook-cell:?execution_count=2&line=1) forecaster = Forecaster()  # Creates forecasts and stores the result
----> [2](vscode-notebook-cell:?execution_count=2&line=2) result = forecaster.run_forecast_config(  # result is also stored as `forecaster.forecast_result`.
      [3](vscode-notebook-cell:?execution_count=2&line=3)     df=df,
      [4](vscode-notebook-cell:?execution_count=2&line=4)     config=ForecastConfig(
      [5](vscode-notebook-cell:?execution_count=2&line=5)         model_template=ModelTemplateEnum.AUTO.name,
      [6](vscode-notebook-cell:?execution_count=2&line=6)         forecast_horizon=365,  # forecasts 365 steps ahead
      [7](vscode-notebook-cell:?execution_count=2&line=7)         coverage=0.95,         # 95% prediction intervals
      [8](vscode-notebook-cell:?execution_count=2&line=8)         metadata_param=metadata
      [9](vscode-notebook-cell:?execution_count=2&line=9)     )
     [10](vscode-notebook-cell:?execution_count=2&line=10) )
File [~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:375](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:375), in Forecaster.run_forecast_config(self, df, config)
    [349](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:349) def run_forecast_config(
    [350](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:350)         self,
    [351](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:351)         df: pd.DataFrame,
    [352](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:352)         config: Optional[ForecastConfig] = None) -> ForecastResult:
    [353](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:353)     """Creates a forecast from input data and config.
    [354](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:354)     The result is also stored as ``self.forecast_result``.
    [355](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:355) 
   (...)
    [373](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:373)         according to the ``df`` and ``config`` configuration parameters.
    [374](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecaster.py:374)     """
...
---> [84](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecast_config_defaults.py:84) if computation.n_jobs is None:
     [85](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecast_config_defaults.py:85)     computation.n_jobs = COMPUTATION_N_JOBS
     [86](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jpereira/labs/delete/~/anaconda3/envs/delete/lib/python3.10/site-packages/greykite/framework/templates/forecast_config_defaults.py:86) if computation.verbose is None:

TypeError: _transform_one() missing 1 required positional argument: 'params'

It happens with both github readme and simples forecast examples.

Running python 3.10.2 on a fresh conda env.

FedericoGriggio commented 9 months ago

Hello @eulbdoor I solved this issue using scikit-learn==1.3.1