question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

My clv is coming wrong. It comes negative for many customers. Can you please suggest.

See original GitHub issue
from 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:closed
  • Created 6 years ago
  • Comments:23 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
vruvoracommented, Dec 11, 2018
1reaction
CamDavidsonPiloncommented, Nov 12, 2018

Maybe? That means inference elsewhere would suffer. That may be the solution I go with though. I’ll do some testing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found