sdv-dev / Copulas

A library to model multivariate data using copulas.
https://sdv.dev/Copulas/
Other
532 stars 104 forks source link

RuntimeWarning: divide by zero encountered in true_divide #215

Open avico78 opened 3 years ago

avico78 commented 3 years ago

Environment details

Running py on a Docker (linux)

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(a*b) /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

herolibra commented 3 years ago

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

avico78 commented 3 years ago

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

elainetynan commented 1 year ago

Was this ever solved as I have now got this warning

1073766230 commented 1 year ago

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

CharlesFr commented 1 year ago

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

amontanez24 commented 1 year ago

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