Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _fit_hyper_transformer(self, data):
"""Create and return a new ``rdt.HyperTransformer`` instance.
First get the ``dtypes`` and then use them to build a transformer dictionary
to be used by the ``HyperTransformer``.
Returns:
rdt.HyperTransformer
"""
dtypes = self.get_dtypes(ids=False)
transformers_dict = self._get_transformers(dtypes)
self._hyper_transformer = rdt.HyperTransformer(transformers=transformers_dict)
self._hyper_transformer.fit(data[list(dtypes.keys())])
First get the ``dtypes`` and ``pii fields`` from a given table, then use
those to build a transformer dictionary to be used by the ``HyperTransformer``.
Args:
table_name (str):
Table name for which to load the HyperTransformer.
Returns:
rdt.HyperTransformer:
Instance of ``rdt.HyperTransformer`` for the given table.
"""
dtypes = self.get_dtypes(table_name)
pii_fields = self._get_pii_fields(table_name)
transformers_dict = self._get_transformers(dtypes, pii_fields)
return HyperTransformer(transformers=transformers_dict)