ColtAllen / btyd

Buy Till You Die and Customer Lifetime Value statistical models in Python.
https://btyd.readthedocs.io/
Apache License 2.0
114 stars 9 forks source link

Fix Plotting Dependencies on Calibration vs. Holdout Purchases #50

Open ColtAllen opened 2 years ago

ColtAllen commented 2 years ago

It's been a longstanding issue in the legacy Lifetimes library that the plot_calibration_purchases_vs_holdout_purchases function in plotting.py cannot be used without first running data through calibration_and_holdout_data in utils.py. This is a useful plotting function for model evaluation, but for those of us working with huge volumes of transaction data, utils.py just isn't going to cut it and the RFM aggregations must be done in a separate service like Spark or Snowflake, effectively blocking the use of this function.

Replacing the _calibration_holdoutmatrix argument with separate _calibrationmatrix and _holdoutmatrix arguments should be enough to resolve this matter.