Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)