build/lib/AutoMxL/Preprocessing/Outliers.py
def transform(self, df, verbose=False):
        """Transform dataset  features using the encoder.
        Can be done only if encoder has been fitted

        Parameters
        ----------
        df : DataFrame
            dataset to transform
        verbose : boolean (Default False)
            Get logging information
        """
        assert self.is_fitted, 'fit the encoding first using .fit method'
        df_local = df.copy()

        # cat features
        if len(list(self.d_cat_outliers.keys())) > 0:
            if verbose:
                print(" - cat aggregated values:")
            for col in self.d_cat_outliers.keys():
                df_local = replace_category(df_local, col, self.d_cat_outliers[col], replace_with='outliers',
                                            verbose=verbose)

        # num features
        if len(list(self.d_num_outliers.keys())) > 0:
            if verbose:
                print(" - num values replaces:")
            for col in self.d_num_outliers.keys():
                df_local = replace_extreme_values(df_local, col, self.d_num_outliers[col][0],
                                                  self.d_num_outliers[col][1], verbose=verbose)

        # if no features with outliers
        if len(list(self.d_cat_outliers.keys())) + len(list(self.d_num_outliers.keys())) == 0:
            print("  > no outlier to replace")

        return df_local
Transform dataset  features using the encoder.
        Can be done only if encoder has been fitted

        Parameters
        ----------
        df : DataFrame
            dataset to transform
        verbose : boolean (Default False)
            Get logging information
        
Transform dataset  features using the encoder.
Can be done only if encoder has been fitted

Parameters

df : DataFrame
dataset to transform
verbose : boolean (Default False)
Get logging information
Transform dataset features using the encoder . Can be done only if encoder has been fitted Parameters df : DataFrame dataset to transform verbose : boolean ( Default False ) Get logging information
def transform(self, df, verbose=False):
        assert self.is_fitted, 'fit the encoding first using .fit method'
        df_local = df.copy()
        if len(list(self.d_cat_outliers.keys())) > 0:
            if verbose:
                print(" - cat aggregated values:")
            for col in self.d_cat_outliers.keys():
                df_local = replace_category(df_local, col, self.d_cat_outliers[col], replace_with='outliers',
                                            verbose=verbose)
        if len(list(self.d_num_outliers.keys())) > 0:
            if verbose:
                print(" - num values replaces:")
            for col in self.d_num_outliers.keys():
                df_local = replace_extreme_values(df_local, col, self.d_num_outliers[col][0],
                                                  self.d_num_outliers[col][1], verbose=verbose)
        if len(list(self.d_cat_outliers.keys())) + len(list(self.d_num_outliers.keys())) == 0:
            print("  > no outlier to replace")
        return df_local
def transform ( self , df , verbose = False ) : assert self . is_fitted , 'fit the encoding first using .fit method' df_local = df . copy ( ) if len ( list ( self . d_cat_outliers . keys ( ) ) ) > 0 : if verbose : print ( " - cat aggregated values:" ) for col in self . d_cat_outliers . keys ( ) : df_local = replace_category ( df_local , col , self . d_cat_outliers [ col ] , replace_with = 'outliers' , verbose = verbose ) if len ( list ( self . d_num_outliers . keys ( ) ) ) > 0 : if verbose : print ( " - num values replaces:" ) for col in self . d_num_outliers . keys ( ) : df_local = replace_extreme_values ( df_local , col , self . d_num_outliers [ col ] [ 0 ] , self . d_num_outliers [ col ] [ 1 ] , verbose = verbose ) if len ( list ( self . d_cat_outliers . keys ( ) ) ) + len ( list ( self . d_num_outliers . keys ( ) ) ) == 0 : print ( "  > no outlier to replace" ) return df_local
Transform dataset  features using the encoder.
Transform dataset features using the encoder .
"""Transform dataset  features using the encoder.
        Can be done only if encoder has been fitted

        Parameters
        ----------
        df : DataFrame
            dataset to transform
        verbose : boolean (Default False)
            Get logging information
        """ # cat features # num features # if no features with outliers
self
df
verbose