[英]lifetimes library - ISSUE of calculating CLV when using function: customer_lifetime_value of GammaGammaFitter
I'm trying to calculate CLV(Customer Life Value) using lifetimes
python library我正在尝试使用
lifetimes
python 库计算 CLV(客户生命价值)
so, I am fitting purchase behavior data on ParetoNBDFitter
and fitting purchase price data on GammaGammaFitter
.所以,我在装修购买行为数据
ParetoNBDFitter
及配件购买价格数据GammaGammaFitter
。
and When I'm trying to calculate CLV based on GammaGammaFitter.customer_lifetime_value()
, there are same errors about并且当我尝试根据
GammaGammaFitter.customer_lifetime_value()
计算 CLV 时,也存在相同的错误
NotImplementedError: Cannot apply ufunc <ufunc 'hyp2f1'> to mixed DataFrame and Series inputs.
Interestingly, I could calculate the CLV yesterday successfully, but today the above error is coming out.有趣的是,我昨天可以成功计算CLV,但今天却出现了上述错误。 The code and data have not been modified.
代码和数据没有被修改。
My code looped by date, each time I redefined the model and then calculated the CLV.我的代码按日期循环,每次我重新定义模型然后计算 CLV。
解决方法:使用 numpy 而不是系列,即不是使用 f.frequency,而是 f.frequency.values
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.