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.

doubts about BG/NBD data shape, and parameters from conditional_expected_number function

See original GitHub issue

First of all, I dont have words to compliment and congratulate for this amazing work.

I have a couple doubts about the BG/NBD model

  1. Reading the docs, customers with one purchase should be given a recency of 0 which I did but when I tried to train my model I faced a lot of issues as:

    RuntimeWarning: invalid value encountered in multiply
      defvjp(anp.exp,    lambda ans, x : lambda g: ans * g)
    RuntimeWarning: divide by zero encountered in log
    The model did not converge. Try adding a larger penalizer to see if that helps convergence.

    In the end, I could only train my model after exclude customers with one purchase , why that so?

  2. In the conditional_expected_number_of_purchases_up_to_time function the t parameter refers to which unit of time?

Again, thank you so much, sorry for my English, congratulations to your work from Brazil.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

wallacez1commented, Nov 27, 2019


“frequency represents the number of repeat purchases the customer has made. This means that it’s one less than the total number of purchases. This is actually slightly wrong. It’s the count of time periods the customer had a purchase in:” i got a little confuse with that definition

this is sample of my data, i took frequency as the number of repeat purchases that a customer has made and manually assign value 0 to recency.

thank you in advance.

wallacez1commented, Nov 20, 2019

customers with one purchase should be given a recency of 0

I think you meant frequency of 0?

Hey @clausherther, took it from the docs:

recency represents the age of the customer when they made their most recent purchases. This is equal to the duration between a customer’s first purchase and their latest purchase. (Thus if they have made only 1 purchase, the recency is 0.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

BG/NBD Model in PyMC - Dr. Juan Camilo Orduz
Let us extract the data as arrays and recover the notation from the original papers. n = data_df.shape[0] x = data_df["frequency"].to_numpy() ...
Read more >
Customer Life Time Value Prediction by Using BG-NBD ...
In this story, I'll try to explain what BG-NBD Model is, ... It gives us the conditional expected number of transactions in the...
Read more >
BG/NBD models — bgnbd • CLVTools
S4 method for bgnbd(, start.params.model = c(), optimx.args ... a : shape parameter of the Beta distribution of the dropout process....
Read more >
Modeling and Application of Customer Lifetime Value ... - MDPI
available historical data to estimate customer value. ... The CLV approach plays an important role in that process, as it enables.
Read more >
Fader/Hardie BG/NBD model. Interpretation of - a - and - b
The BG/NBD model I'm working with also returns 4 parameters: r: shape parameter of the Gamma distribution of the purchase process. alpha: scale ......
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 Post

No results found

github_iconTop Related Hashnode Post

No results found