luke14free / pm-prophet

GAM timeseries modeling with auto-changepoint detection. Inspired by Facebook Prophet and implemented in PyMC3
325 stars 42 forks source link

AttributeError when fitting example model #19

Closed AlexAndorra closed 4 years ago

AlexAndorra commented 4 years ago

Hi and thank you for this very useful project! It's been a while since I wanted to give it a try and I finally found a use case :) However, trying to get started, I couldn't run the model you have in the examples: when hitting m.fit(method='NUTS') I encountered:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-f9eeec8c375f> in <module>
      1 # Fit the model (using NUTS)
----> 2 m.fit(method='NUTS')

~/opt/anaconda3/envs/fund/lib/python3.7/site-packages/pmprophet/model.py in fit(self, draws, chains, trace_size, method, map_initialization, finalize, step_kwargs, sample_kwargs)
    610             if draws:
    611                 if method != Sampler.ADVI:
--> 612                     step_method = method.value(**step_kwargs)
    613                     self.trace = pm.sample(
    614                         draws,

AttributeError: 'str' object has no attribute 'value'

I also tried on the dataframe I'm trying to fit and it has the same behavior. Does it look like an issue? Or could it come from my installation? I'm running on pm-prophet 0.2.8, PyMC3 master and theano 1.0.4. Thanks in advance for your help, and thanks again for your work!

luke14free commented 4 years ago

Hi @AlexAndorra - Apologies for the late answer. Samplers are actually a class now, so you will need to import them and call the method with m.fit(method=Sampler.NUTS)