Skip to content

Instantly share code, notes, and snippets.

@meraldo-aliz
Last active March 2, 2022 04:12
Show Gist options
  • Save meraldo-aliz/b3a9b77f6afcd2bbba9abde8b78dfeff to your computer and use it in GitHub Desktop.
Save meraldo-aliz/b3a9b77f6afcd2bbba9abde8b78dfeff to your computer and use it in GitHub Desktop.
lifetimes
# This function calculates the conditional expected number of transactions in the given time length
n_transactions_pred = bgf.predict(t=26, # we set it to 26 weeks (the length of the observation period)
frequency=sample_customer['frequency_cal'],
recency=sample_customer['recency_cal'],
T=sample_customer['T_cal'])
n_transactions_pred # = 0.7647440846242359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment