Code Monkey home page Code Monkey logo

Comments (4)

DanielBok avatar DanielBok commented on May 28, 2024

Ah.. the issue is not copulae. As you can see, the 3.6 wheel for copulae exists. The issue is that scipy stopped supporting 3.6 since their 1.6 release.

One way to solve this is to install scipy first. Then install copulae.

from copulae.

Nishan-Pradhan avatar Nishan-Pradhan commented on May 28, 2024

Thanks for your response, I managed to install copulae with that method but getting unexpected errors now, perhaps due to my current module versions?

Does this example code still work?

from copulae.datasets import load_residuals, load_marginal_data
from copulae import GaussianCopula, StudentCopula

residuals = load_residuals()
residuals.head()

_, ndim = residuals.shape
g_cop = GaussianCopula(dim=ndim)  # initializing the copula
g_cop.fit(residuals)

I am getting a ValueError like below:

 File "<ipython-input-54-d2563863>", line 9, in <module>
    g_cop.fit(residuals)
  File "/users/is/npr/pyenvs/search/lib/python3.6/site-packages/copulae/copula/base.py", line 134, in fit
    elif np.any((data < 0) | (data > 1)):
  File "/lib/python3.6/site-packages/pandas-0.22.0-linux-x86_64.egg/pandas/core/generic.py", line 1121, in __nonzero__
    .format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

from copulae.

DanielBok avatar DanielBok commented on May 28, 2024

I did the following and it worked okay

conda create -n py36 python=3.6 copulae
conda activate py36
python
from copulae.datasets import load_residuals, load_marginal_data
from copulae import GaussianCopula, StudentCopula

residuals = load_residuals()
residuals.head()

_, ndim = residuals.shape
g_cop = GaussianCopula(dim=ndim)  # initializing the copula
g_cop.fit(residuals)

image

from copulae.

DanielBok avatar DanielBok commented on May 28, 2024

It looks like an error raised by pandas. Try getting your packages up to requirements first

requirements = [
    'numpy >=1.19',
    'pandas >=1.1',
    'scikit-learn >=0.23',
    'scipy >=1.5',
    'statsmodels >=0.12.1',
    "typing-extensions >=3.7.4.3; python_version < '3.8'",
    "wheel >=0.36",
    'wrapt >=1.12'
]

from copulae.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.