Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fir error : __init__() takes exactly 2 positional arguments #1034

Closed
priyankaexp opened this issue Jun 23, 2019 · 3 comments
Closed

fir error : __init__() takes exactly 2 positional arguments #1034

priyankaexp opened this issue Jun 23, 2019 · 3 comments

Comments

@priyankaexp
Copy link

priyankaexp commented Jun 23, 2019

I am getting an error while trying to fit the model

m = Prophet() m.fit(df)

  • Error is

m.fit(df)
File "/Users/priyagupta/anaconda/envs/outlier-detector/lib/python3.5/site-packages/fbprophet/forecaster.py", line 1003, in fit
dat, init=stan_init, iter=1e4, **kwargs)
File "/Users/priyagupta/anaconda/envs/outlier-detector/lib/python3.5/site-packages/pystan/model.py", line 468, in optimizing
fit = self.fit_class(data)
File "stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_6584856068083371156.pyx", line 463, in stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_6584856068083371156.StanFit4Model.init
TypeError: init() takes exactly 2 positional arguments (1 given)

  • dataframe contains

df.head()

ds y
0 2018-01-02 8.493219
1 2018-01-03 8.447772
2 2018-01-04 8.453951
3 2018-01-05 8.504886
4 2018-01-06 8.500543

  • Python version = 3.5.4 (I specifically need 3.5.* python version)
    anaconda version = 4.2.0
    pystan version = 2.14.0.0
    fbprophet version = 0.3.post2

  • I have installed pystan and fbprophet using conda as mention at #pip install fbprophet fails on osx 13.6 #715
    conda install -c conda-forge fbprophet

  • I have also tried with sample csv provided at [https://facebook.github.io/prophet/docs/quick_start.html#python-api]
    and this also provides the same error.

Does anyone know, how can I resolve this error?
To me, this looks like a version mismatch between pystan and fbprophet. Do I need to have specific version of fbprophet?

@priyankaexp
Copy link
Author

I have also tried the steps mentioned here #324

@priyankaexp
Copy link
Author

The issue is solved by installing fbprophet using pip. This installed fbprophet-0.5

@bletham
Copy link
Contributor

bletham commented Jun 28, 2019

hm I'm a bit unsure what happened here. The error was coming from pystan. I wonder if maybe somehow it was trying to use a pystan model that had been pickled under a different version of pystan?. Well, glad to hear that an upgrade fixed it.

@bletham bletham closed this as completed Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants