How to use the copulas.EPSILON function in copulas

To help you get started, we’ve selected a few copulas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HDI-Project / SDV / sdv / tabular / copulas.py View on Github external
values = list()
        triangle = np.tril(self._model.covariance)

        for index, row in enumerate(triangle.tolist()):
            values.append(row[:index + 1])

        self._model.covariance = np.array(values)
        params = self._model.to_dict()
        univariates = dict()
        for name, univariate in zip(params.pop('columns'), params['univariates']):
            univariates[name] = univariate
            if 'scale' in univariate:
                scale = univariate['scale']
                if scale == 0:
                    scale = copulas.EPSILON

                univariate['scale'] = np.log(scale)

        params['univariates'] = univariates

        return flatten_dict(params)

copulas

Create tabular synthetic data using copulas-based modeling.

BSL-1.0
Latest version published 3 months ago

Package Health Score

88 / 100
Full package analysis