How to use the sdgym.synthesizers.utils.Transformer.get_metadata function in sdgym

To help you get started, we’ve selected a few sdgym 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 DAI-Lab / SDGym / tests / synthesizers / test_utils.py View on Github external
'min': 0,
                'max': 5
            },
            {
                "name": 1,
                "type": 'categorical',
                "size": 3,
                "i2s": ['A', 'B', 'C']
            }
        ]

        categorical_columns = [1]
        ordinal_columns = []

        # Run
        result = Transformer.get_metadata(data, categorical_columns, ordinal_columns)

        # Check
        assert result == expected_result
github DAI-Lab / SDGym / sdgym / synthesizers / privbn.py View on Github external
def fit(self, data, categoricals=tuple(), ordinals=tuple()):
        self.data = data.copy()
        self.meta = Transformer.get_metadata(data, categoricals, ordinals)
github DAI-Lab / SDGym / sdgym / synthesizers / uniform.py View on Github external
def fit(self, data, categorical_columns=tuple(), ordinal_columns=tuple()):
        self.dtype = data.dtype
        self.shape = data.shape
        self.meta = Transformer.get_metadata(data, categorical_columns, ordinal_columns)
github DAI-Lab / SDGym / sdgym / synthesizers / privbn.py View on Github external
def fit(self, data, categorical_columns=tuple(), ordinal_columns=tuple()):
        self.data = data.copy()
        self.meta = Transformer.get_metadata(data, categorical_columns, ordinal_columns)
github DAI-Lab / SDGym / sdgym / synthesizers / independent.py View on Github external
def fit(self, data, categorical_columns=tuple(), ordinal_columns=tuple()):
        self.dtype = data.dtype
        self.meta = Transformer.get_metadata(data, categorical_columns, ordinal_columns)

        self.models = []
        for id_, info in enumerate(self.meta):
            if info['type'] == CONTINUOUS:
                model = GaussianMixture(self.gmm_n)
                model.fit(data[:, [id_]])
                self.models.append(model)
            else:
                nomial = np.bincount(data[:, id_].astype('int'), minlength=info['size'])
                nomial = nomial / np.sum(nomial)
                self.models.append(nomial)