luke14free / pm-prophet

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

Example not working on Pandas 1.0 #25

Closed zwelitunyiswa closed 4 years ago

zwelitunyiswa commented 4 years ago

I am really excited about this library but cannot get it to work past fitting the model because of an error where it says "AttributeError": Dataframe object has no attribute 'ix'.

I have tried downgrading pandas to .19 and .23 but still won't work. Would love to get this working.

Screen Shot 2020-04-30 at 9 14 23 AM
ahlusar1989 commented 4 years ago

Hi @zwelitunyiswa - There are a couple things to note. You have correctly identified the version. However, in pandas the ix method is deprecated.

I would use iloc instead. Is there another dependency in your packages that could be causing the issue?

zwelitunyiswa commented 4 years ago

Thanks, @ahlusar1989. It seems that the "ix" method is being used on the "m.fit" method. How would I be able to change it to use "iloc"?

ahlusar1989 commented 4 years ago

@zwelitunyiswa The only instance of ix being used was addressed by this PR. There is no reference in the fit function (unless I am missing something here).

jmloyola commented 4 years ago

@ahlusar1989, you are right. The issue got resolved. But it is not reflected in the pip version. I'd just downloaded it to test something (thanks for the repo btw 🤓) and I got the same error. @zwelitunyiswa if you need to run something now, I will suggest to clone the repository and install with pip install -e $PM-PROPHET-PATH, where $PM-PROPHET-PATH is the path to the cloned repository. If you install using this method you will be able to edit the code of this repository to fit your needs. To run the notebook you will also need to change this line in the example:

m.fit(method='NUTS')

to

m.fit()

These lines do the same since the default sampler is NUTS. If you need another sampler I think you will have to instantiate it beforehand.

ahlusar1989 commented 4 years ago

@jmloyola Thanks for confirming and for the clarification.

zwelitunyiswa commented 4 years ago

Thank you everyone! I appreciate your help.