How to use the lightwood.mixers.helpers.transformer.Transformer function in lightwood

To help you get started, we’ve selected a few lightwood 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 mindsdb / lightwood / scraps / bayesian_nn / bayesian_nn.py View on Github external
def fit_data_source(self, ds):
        self.input_column_names = self.input_column_names \
            if self.input_column_names is not None else ds.get_feature_names('input_features')
        self.output_column_names = self.output_column_names \
            if self.output_column_names is not None else ds.get_feature_names('output_features')

        transformer_already_initialized = False
        try:
            if len(list(ds.transformer.feature_len_map.keys())) > 0:
                transformer_already_initialized = True
        except:
            pass

        if not transformer_already_initialized:
            ds.transformer = Transformer(self.input_column_names, self.output_column_names)

        self.encoders = ds.encoders
        self.transformer = ds.transformer
github mindsdb / lightwood / lightwood / mixers / nn / nn.py View on Github external
if self.output_column_names is not None else ds.get_feature_names('output_features')

        self.out_types = ds.out_types
        for n, out_type in enumerate(self.out_types):
            if out_type == COLUMN_DATA_TYPES.NUMERIC:
                ds.encoders[self.output_column_names[n]].extra_outputs = len(self.quantiles) - 1

        transformer_already_initialized = False
        try:
            if len(list(ds.transformer.feature_len_map.keys())) > 0:
                transformer_already_initialized = True
        except:
            pass

        if not transformer_already_initialized:
            ds.transformer = Transformer(self.input_column_names, self.output_column_names)

        self.encoders = ds.encoders
        self.transformer = ds.transformer