Skip to content

Commit

Permalink
adding multivariate tests
Browse files Browse the repository at this point in the history
Took 4 minutes
  • Loading branch information
tfm000 committed Sep 28, 2023
1 parent f56290e commit 34deb31
Show file tree
Hide file tree
Showing 27 changed files with 292 additions and 105 deletions.
2 changes: 1 addition & 1 deletion sklarpy/tests/multivariate/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from sklarpy.multivariate import distributions_map

num: int = 100
d: int = 3
d: int = 2


@pytest.fixture(scope="session", autouse=True)
Expand Down
28 changes: 28 additions & 0 deletions sklarpy/tests/multivariate/helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contains helper functions for testing SklarPy multivariate code
import os

from sklarpy.multivariate import *
from sklarpy import load

__all__ = ['get_dist']


def get_dist(name: str, d: int = 3) -> tuple:
"""Fits a distribution to data.
Parameters
----------
name : str
The name of the distribution as in distributions_map
d: int
The dimension of the data.
Returns
-------
res: tuple
non-fitted dist, fitted dist, parameters for fitted dist
"""
dist = eval(name)
path: str = f'{os.getcwd()}\\sklarpy\\tests\\multivariate\\{name}_{d}D'
params = load(path)
fitted = dist.fit(params=params)
return dist, fitted, params
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
367 changes: 263 additions & 104 deletions sklarpy/tests/multivariate/test_prefit_dists.py

Large diffs are not rendered by default.

0 comments on commit 34deb31

Please sign in to comment.