(self, raw_data, discrete_columns=())
Fit GMM for continuous columns and One hot encoder for discrete columns.

        This step also counts the #columns in matrix data, and span information.
Fit GMM for continuous columns and One hot encoder for discrete columns.
Fit GMM for continuous columns and One hot encoder for discrete columns .
def fit(self, raw_data, discrete_columns=()):
        """Fit GMM for continuous columns and One hot encoder for discrete columns.

        This step also counts the #columns in matrix data, and span information.
        """
        self.output_info_list = []
        self.output_dimensions = 0
        self.dataframe = True

        if not isinstance(raw_data, pd.DataFrame):
            self.dataframe = False
            # work around for RDT issue #328 Fitting with numerical column names fails
            discrete_columns = [str(column) for column in discrete_columns]
            column_names = [str(num) for num in range(raw_data.shape[1])]
            raw_data = pd.DataFrame(raw_data, columns=column_names)

        self._column_raw_dtypes = raw_data.infer_objects().dtypes
        self._column_transform_info_list = []
        for column_name in raw_data.columns:
            raw_column_data = raw_data[column_name].to_numpy()
            if column_name in discrete_columns:
                column_transform_info = self._fit_discrete(column_name, raw_data[column_name])
            else:
                column_transform_info = self._fit_continuous(column_name, raw_column_data)

            self.output_info_list.append(column_transform_info.output_info)
            self.output_dimensions += column_transform_info.output_dimensions
            self._column_transform_info_list.append(column_transform_info)
def fit ( self , raw_data , discrete_columns = ( ) ) : self . output_info_list = [ ] self . output_dimensions = 0 self . dataframe = True if not isinstance ( raw_data , pd . DataFrame ) : self . dataframe = False # work around for RDT issue #328 Fitting with numerical column names fails discrete_columns = [ str ( column ) for column in discrete_columns ] column_names = [ str ( num ) for num in range ( raw_data . shape [ 1 ] ) ] raw_data = pd . DataFrame ( raw_data , columns = column_names ) self . _column_raw_dtypes = raw_data . infer_objects ( ) . dtypes self . _column_transform_info_list = [ ] for column_name in raw_data . columns : raw_column_data = raw_data [ column_name ] . to_numpy ( ) if column_name in discrete_columns : column_transform_info = self . _fit_discrete ( column_name , raw_data [ column_name ] ) else : column_transform_info = self . _fit_continuous ( column_name , raw_column_data ) self . output_info_list . append ( column_transform_info . output_info ) self . output_dimensions += column_transform_info . output_dimensions self . _column_transform_info_list . append ( column_transform_info )