我正在尝试使用生命周期标头从给定数据创建新近度、频率和 T,但它一直显示以下错误 AttributeError: module 'scipy.misc' has no attribute 'logsumexp'
from lifetimes.plotting import *
from lifetimes.utils import *
from lifetimes.estimation import *
data = summary_data_from_transaction_data(df, 'CustomerID','InvoiceDate', monetary_value_col='Sales', observation_period_end='2011-12-9')
print(data.head())
收到以下输出:
Traceback (most recent call last):
File "prj2.py", line 23, in <module>
from lifetimes.plotting import *
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\lifetimes\__init__.py", line 5, in <module>
from .fitters.beta_geo_fitter import BetaGeoFitter
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\lifetimes\fitters\beta_geo_fitter.py", line 9, in <module>
from autograd.scipy.special import gammaln, beta, gamma
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\autograd\scipy\__init__.py", line 7, in <module>
from . import misc
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\autograd\scipy\misc.py", line 7, in <module>
logsumexp = primitive(scipy.misc.logsumexp)
AttributeError: module 'scipy.misc' has no attribute 'logsumexp'
SciPy 的版本是 1.3.0 代码应该生成一个表格,其中包含每个客户的 Recency、Frequency 和 T