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.

BetaGeoFitter: RuntimeWarning: overflow encountered in double_scalars

See original GitHub issue

Running this

from lifetimes.plotting import plot_frequency_recency_matrix

_, ax = plt.subplots(1, 1, figsize=(10, 8))
plot_frequency_recency_matrix(bgf);

on a bgf with parameters lifetimes.BetaGeoFitter: fitted with 2556392 subjects, a: 0.40, alpha: 50.16, b: 0.81, r: 0.10

results in

beta_geo_fitter.py:205: RuntimeWarning: overflow encountered in double_scalars
  denominator = 1 + (x > 0) * (a / (b + x - 1)) * ((alpha + T) / (alpha + recency)) ** (r + x)

The plot still shows up though.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:13

github_iconTop GitHub Comments

2reactions
zerualemcommented, Jan 21, 2020

Hi @zerualem , did you find a solution? Or was resampling by week the best solution?

For now, re-sampling is the only option for me. Read here also Overcoming the BG/NBD Model’s #NUM! Error Problem

0reactions
Shubham080597commented, Jul 8, 2020

@zerualem: I am getting this error again and again please help out I have try the above things still getting the error

C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:75: RuntimeWarning: invalid value encountered in multiply defvjp(anp.exp, lambda ans, x : lambda g: ans * g) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:75: RuntimeWarning: invalid value encountered in multiply defvjp(anp.exp, lambda ans, x : lambda g: ans * g) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:75: RuntimeWarning: invalid value encountered in multiply defvjp(anp.exp, lambda ans, x : lambda g: ans * g) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:75: RuntimeWarning: invalid value encountered in multiply defvjp(anp.exp, lambda ans, x : lambda g: ans * g) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:75: RuntimeWarning: invalid value encountered in multiply defvjp(anp.exp, lambda ans, x : lambda g: ans * g) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\tracer.py:48: RuntimeWarning: divide by zero encountered in log return f_raw(*args, **kwargs) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\tracer.py:48: RuntimeWarning: invalid value encountered in add return f_raw(*args, **kwargs) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:75: RuntimeWarning: invalid value encountered in multiply defvjp(anp.exp, lambda ans, x : lambda g: ans * g) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\numpy\numpy_vjps.py:78: RuntimeWarning: divide by zero encountered in double_scalars defvjp(anp.log, lambda ans, x : lambda g: g / x) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\tracer.py:48: RuntimeWarning: divide by zero encountered in log return f_raw(*args, **kwargs) C:\Users\shubham.kumar\AppData\Local\Continuum\anaconda3\lib\site-packages\autograd\tracer.py:48: RuntimeWarning: overflow encountered in power return f_raw(*args, **kwargs)

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - What are the causes of overflow encountered in ...
Overflow error implies that an operation yields a value out of the range defined for the corresponding data type.
Read more >
Python: Overflow Encountered In Double-Scalars - ADocLib
Error: RuntimeWarning: overflow encountered in longscalars # Solution: # This error usually comes up because the data type you're using can't # ...
Read more >
CLV Kaggle.pdf - BI Open
BetaGeoFitter : fitted with 234385 subjects, a: 1.04, alpha: 45.52, b: 12.48, r: 0.99> ... RuntimeWarning: overflow encountered in double_scalars.
Read more >
runtimewarning: invalid value encountered in double_scalars
This tutorial explains how to fix the following error in Python: runtimewarning: invalid value encountered in double_scalars.
Read more >
Customer Life Time Value Prediction - Kaggle
BG/NBD Model bgf = BetaGeoFitter(penalizer_coef=0.001) ... RuntimeWarning: overflow encountered in double_scalars denominator = 1 + (x > 0) * (a / (b +...
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