Created
March 2, 2022 05:45
-
-
Save meraldo-aliz/b6c14945922570ff69cc33c28f03d672 to your computer and use it in GitHub Desktop.
lifetimes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the real number of transactions in the observation period, which equals frequency_holdout + 1 | |
rfm_cal_holdout["n_transactions_holdout_real"] = rfm_cal_holdout["frequency_holdout"] + 1 | |
# the predicted number of transactions in the next 26 weeks (length of the observation period) | |
rfm_cal_holdout["n_transactions_holdout_pred"] = bgf.predict(t=26, | |
frequency=rfm_cal_holdout['frequency_cal'], | |
recency=rfm_cal_holdout['recency_cal'], | |
T=rfm_cal_holdout['T_cal']) | |
# comparison of the real and predicted transactions | |
rfm_cal_holdout[["n_transactions_holdout_real", "n_transactions_holdout_pred"]].head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment