My clv is coming wrong. It comes negative for many customers. Can you please suggest.
See original GitHub issuefrom lifetimes import GammaGammaFitter
ggf = GammaGammaFitter(penalizer_coef = 0)
ggf.fit(df['x'], df['Margin'])
df['clv'] = 0.0
results = {}
results_pnbd_p = {}
for i in prodname:
temp= df[df["PROD_MODEL"]==i]
ggf = GammaGammaFitter(penalizer_coef = 0)
ggf.fit(temp['x'], temp['Margin'])
pnbd = ParetoNBDFitter()
mod = pnbd.fit(temp['x'], temp['t_x'], temp['T'])
results[i] = mod.params_.values()
try:
temp['clv'] = ggf.customer_lifetime_value(mod, #the model to use to predict the number of future transactions
temp['x'], temp['t_x'], temp['T'], temp['Margin'],
time=12, # months
discount_rate=0.1)
except:
continue
print i
print results
for j in temp.index:
df.ix[j,'clv'] = temp['clv'][j]
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (16 by maintainers)
Top Results From Across the Web
How To Use, And Misuse, Customer Lifetime Value (CLV)
When it comes to searching online you will see broadly speaking two types of advice. Some bad advice, and some truly terrible advice....
Read more >What Is Customer Lifetime Value (CLV)? - Qualtrics
Customer lifetime value (CLV) is one of the key stats to track as part of a customer experience program. Learn what customer lifetime...
Read more >Customer Lifetime Value (CLV) - how to calculate, measure ...
Customer lifetime value represents the total income a business can expect from a customer throughout the business relationship.
Read more >Can Customer Lifetime Value Be Negative? - YouTube
Customer Life Time value gives you a clue as to where to spend your resources such as time and money. In this video,...
Read more >14 Proven Tactics to Increase Your Customer Lifetime Value ...
Email marketing is one of the best ways to retain customers, but many businesses go about it the wrong way. Instead of sending...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@CamDavidsonPilon Apologies for the delay. Here it is: https://github.com/CamDavidsonPilon/lifetimes/pull/236
Maybe? That means inference elsewhere would suffer. That may be the solution I go with though. I’ll do some testing.