gamma gamma fitter

Solutions on MaxInterview for gamma gamma fitter by the best coders in the world

showing results for - "gamma gamma fitter"
Augustin
16 Jul 2018
1# refit the BG model to the summary_with_money_value dataset
2bgf.fit(summary_with_money_value['frequency'], summary_with_money_value['recency'], summary_with_money_value['T'])
3
4print(ggf.customer_lifetime_value(
5    bgf, #the model to use to predict the number of future transactions
6    summary_with_money_value['frequency'],
7    summary_with_money_value['recency'],
8    summary_with_money_value['T'],
9    summary_with_money_value['monetary_value'],
10    time=12, # months
11    discount_rate=0.01 # monthly discount rate ~ 12.7% annually
12).head(10))
13"""
14customer_id
151      140.096211
162       18.943467
173       38.180574
184       38.180574
195       38.180574
206     1003.868107
217       28.109683
228       38.180574
239      167.418216
2410      38.180574
25Name: clv, dtype: float64
26"""
27