Copulas icon indicating copy to clipboard operation
Copulas copied to clipboard

RuntimeWarning: divide by zero encountered in true_divide

Open avico78 opened this issue 3 years ago • 6 comments

Environment details

Running py on a Docker (linux)

  • Copulas version: copulas==0.5.0 sdv==0.8.0

  • Python version:

  • 3.8

  • Operating System: Debian GNU/Linux 10

Problem description

following example on : https://sdv.dev/SDV/user_guides/single_table/gaussian_copula.html

script:

    from sdv.demo import load_tabular_demo
    data = load_tabular_demo('student_placements')
    from sdv.tabular import GaussianCopula
    model = GaussianCopula()
    model.fit(data)

error:

/usr/local/lib/python3.8/site-packages/scipy/stats/_continuous_distns.py:5003: RuntimeWarning: divide by zero encountered in true_divide return c2 / (c2 - n**2) /usr/local/lib/python3.8/site-packages/scipy/stats/_distn_infrastructure.py:2494: RuntimeWarning: invalid value encountered in double_scalars Lhat = muhat - Shatmu /usr/local/lib/python3.8/site-packages/scipy/stats/_continuous_distns.py:621: RuntimeWarning: invalid value encountered in sqrt sk = 2(b-a)np.sqrt(a + b + 1) / (a + b + 2) / np.sqrt(ab) /usr/local/lib/python3.8/site-packages/scipy/optimize/minpack.py:175: RuntimeWarning: The iteration is not making good progress, as measured by the improvement from the last ten iterations. warnings.warn(msg, RuntimeWarning) /usr/local/lib/python3.8/site-packages/scipy/optimize/minpack.py:175: RuntimeWarning: The number of calls to function has reached maxfev = 600. warnings.warn(msg, RuntimeWarning) /usr/local/lib/python3.8/site-packages/copulas/univariate/truncated_gaussian.py:43: RuntimeWarning: invalid value encountered in double_scalars a = (self.min - loc) / scale /usr/local/lib/python3.8/site-packages/copulas/univariate/truncated_gaussian.py:44: RuntimeWarning: divide by zero encountered in double_scalars

avico78 avatar Feb 27 '21 17:02 avico78

I am also having the same problem, have you solved it by now?

herolibra avatar Apr 08 '21 09:04 herolibra

I am also having the same problem, have you solved it by now?

Actually not ,the thing that it failed on the demo using same script as in the example ...so not sure where is the problem

avico78 avatar Apr 08 '21 10:04 avico78

Was this ever solved as I have now got this warning

elainetynan avatar Jan 09 '23 22:01 elainetynan

I am also having the same problem, have you solved it by now?

Actually not ,the thing that it failed on the demo using same script as in the example ...so not sure where is the problem

the same problem,,

1073766230 avatar Apr 12 '23 12:04 1073766230

I'm getting the same issue - @amontanez24 could you please provide a pointer?

CharlesFr avatar May 28 '23 20:05 CharlesFr

Hi @CharlesFr! Is the code you're running actually failing or just raising a warning?

amontanez24 avatar Jun 06 '23 19:06 amontanez24