AttributeError: 'BetaGeoFitter' object has no attribute 'summary'/'param_' respectively
See original GitHub issueIt appears that for some reason certain attributes are not being “loaded” (new to python…likely the incorrect jargon). When making a new LTV notebook and following the quick-start guide I can successfully call .fit
and print BetaGeoFitter
. After that the docs reference having access to the attributes summary
and param_
however when attempting to call BetaGeoFitter.summary
and BetaGeoFitter.param_
I get AttributeError: 'BetaGeoFitter' object has no attribute 'summary' / 'param_'
respectively.
Running dir(BetaGeoFitter) gives me the following:
['__class__',
'__delattr__',
'__dict__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__le__',
'__lt__',
'__module__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'__weakref__',
'_negative_log_likelihood',
'_unload_params',
'conditional_expected_number_of_purchases_up_to_time',
'conditional_probability_alive',
'conditional_probability_alive_matrix',
'expected_number_of_purchases_up_to_time',
'fit',
'load_model',
'probability_of_n_purchases_up_to_time',
'save_model']
of which summay and param_
are missing. looking at the attributes present, I have no issues calling anything shown here.
I don’t know if this is an issue with __init__.py
but potentially having a local call to def summary(self) could alleviate the issue?? Like I said… I’m pretty new to Python so I could be way off.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top GitHub Comments
installed 3 separate versions of notebook and replicated the packages and versions as shown above and had no issues with running the full library. I will keep an eye on this and reopen the issue if it happens again. I will be sure to better outline the versions and libraries installed instantly if I run into this again.
I nuked the env that I was running this in and created a fresh evn with
python==3.6.9
. I installedlifetimes==0.11.1
and followed the Quickstart Tutorial in the terminal line by line and had no issues. Was able to runbgf.summary
and all of the new attributes with no issues. I then installed JN usingpip install notebook
, again in the virtual environment, and ran through the same Quickstart Guide line by line. Again…no issues. Able to run all utilities and call all attributes with no errors. When I check my current environment vs the previous usingpip list
I found that I was using a version of notebook that I had previously installed usingpip install --user notebook
because I didn’t see any of the dependencies installed in the previouspip list
.I think my next step is to look at the list above and install each library line by line into my virtual environment and see which one breaks it.
All that to say it looks as though this is not a version issue or an issue with the library itself, but could be related to a package that I had installed and is potentially from a dependency installed in a recent install of
pip install --user notebook
.Given the popularity of
Jupyter Notebook
there should likely be a note stating a minimumnotebook
version recommended which I will be glad to supply. If you don’t think this is necessary then please feel free to close the comment.