TypeError beta_geo_beta_binom_fitter.py
Using the plotting.plot_period_transactions with a condensed RFM matrix for the BGBB fitter and received this error.
~\AppData\Local\Continuum\anaconda3\lib\site-packages\lifetimes\fitters\beta_geo_beta_binom_fitter.py in <lambda>(size)
167 self.generate_new_data = lambda size=1: beta_geometric_beta_binom_model(
168 # Making a large array replicating n by n_custs having n.
--> 169 np.array(sum([n_] * n_cust for (n_, n_cust) in zip(n_periods, weights))),
170 *self._unload_params("alpha", "beta", "gamma", "delta"),
171 size=size
TypeError: unsupported operand type(s) for +: 'int' and 'list'
Original:
np.array(sum([n_] * n_cust for (n_, n_cust) in zip(n_periods, weights))),
Updated:
np.array(sum(([n_] * n_cust for (n_, n_cust) in zip(n_periods, weights)),[])),
hm, I wonder if this is a new bug (0.11+), or has always been around. What version of lifetimes, python and Pandas are you using?
It was around in version 10 of lifetimes. I meant to mention it earlier in the week when I started fooling with the BGBB, but it just slipped my mind. I'm using 11.1 now and pandas 0.24.1.
Awesome, thanks! I'll fix and write some regression tests for it
NP. QQ for you. Are the calibration graphs meant to be used with with a BGBB model that's been trained on a condensed RFM matrix? I had to make some changes to get plot_period_transactions to behave as intended.
hi quick Q on a fix for this issue?