(self, raw_data)
return np.concatenate(column_data_list, axis=1).astype(float)
Take raw data and output a matrix data.
Take raw data and output a matrix data.
Take raw data and output a matrix data .
def transform(self, raw_data):
        """Take raw data and output a matrix data."""
        if not isinstance(raw_data, pd.DataFrame):
            column_names = [str(num) for num in range(raw_data.shape[1])]
            raw_data = pd.DataFrame(raw_data, columns=column_names)

        column_data_list = []
        for column_transform_info in self._column_transform_info_list:
            column_data = raw_data[[column_transform_info.column_name]].to_numpy()
            if column_transform_info.column_type == 'continuous':
                column_data_list += self._transform_continuous(column_transform_info, column_data)
            else:
                assert column_transform_info.column_type == 'discrete'
                column_data_list += self._transform_discrete(column_transform_info, column_data)

        return np.concatenate(column_data_list, axis=1).astype(float)
def transform ( self , raw_data ) : if not isinstance ( raw_data , pd . DataFrame ) : column_names = [ str ( num ) for num in range ( raw_data . shape [ 1 ] ) ] raw_data = pd . DataFrame ( raw_data , columns = column_names ) column_data_list = [ ] for column_transform_info in self . _column_transform_info_list : column_data = raw_data [ [ column_transform_info . column_name ] ] . to_numpy ( ) if column_transform_info . column_type == 'continuous' : column_data_list += self . _transform_continuous ( column_transform_info , column_data ) else : assert column_transform_info . column_type == 'discrete' column_data_list += self . _transform_discrete ( column_transform_info , column_data ) return np . concatenate ( column_data_list , axis = 1 ) . astype ( float )