Skip to content

Instantly share code, notes, and snippets.

@lucdangelis
Last active May 27, 2019 20:29
Show Gist options
  • Save lucdangelis/97cb488bb251a7949dd1db4f1f2e8629 to your computer and use it in GitHub Desktop.
Save lucdangelis/97cb488bb251a7949dd1db4f1f2e8629 to your computer and use it in GitHub Desktop.
cal_hold = calibration_and_holdout_data(trans_dataset,
'customer_id',
'date',
calibration_period_end='2018-04-30', #2 years calibration
observation_period_end='2019-04-30', #1 year holdout
freq = 'M')
cal_hold.head()
bgf = BetaGeoFitter()
bgf.fit(cal_hold['frequency'], cal_hold['recency'], cal_hold['T'])
plot_calibration_purchases_vs_holdout_purchases(bgf, cal_hold)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment