CamDavidsonPilon / lifetimes

Lifetime value in Python
MIT License
1.45k stars 375 forks source link

P_alive plot not showing blue line #306

Closed maria-ferreira-olx closed 2 months ago

maria-ferreira-olx commented 5 years ago

The code works ok, but when plotting P_alive it doesn't show the p, only the purhcases image it works on other dataset, but not following this one https://github.com/susanli2016/Machine-Learning-with-Python/blob/master/CLV_Online_Retail.ipynb

psygo commented 5 years ago

That's actually probably because the fitted model has parameters that force P_alive to be very close to either 0 or 1.

Try using the conditional_probability_alive() model's method to inspect various customers' P_alive. There is also a calculate_alive_path() function in the utils.py file that might be useful — it uses conditional_probability_alive() and is the function being called inside the plot_alive_path().

Also, please post code snippets and graphs, not screenshots, it's much easier for others to debug.