src/03_modelling/011_modelling.py
def convert_for_output(df):
        """
        This function convert the output of evaluate model
        to more concise form. It will return a confusion matrix
        and an accuracy matrix
        """
        renew_df = pd.DataFrame.from_dict(df['renewed'])
        renew_df.columns = ['renwed']
        renew_df['label'] = ['f1', 'recall', 'precision']
        renew_df.set_index('label', inplace=True)

        no_df = pd.DataFrame.from_dict(df['not_renewed'])
        no_df.columns = ['not_renwed']
        no_df['label'] = ['f1', 'recall', 'precision']
        no_df.set_index('label', inplace=True)

        confusion = pd.concat([renew_df, no_df], axis=1)

        accu = pd.DataFrame(df['accuracy'])
        accu.columns = ['accuracy']
        accu['label'] = ['train', 'validation']
        accu.set_index('label', inplace=True)

        return confusion, accu

        This function convert the output of evaluate model
        to more concise form. It will return a confusion matrix
        and an accuracy matrix
        
This function convert the output of evaluate model
to more concise form. It will return a confusion matrix
and an accuracy matrix
This function convert the output of evaluate model to more concise form . It will return a confusion matrix and an accuracy matrix
def convert_for_output(df):
        renew_df = pd.DataFrame.from_dict(df['renewed'])
        renew_df.columns = ['renwed']
        renew_df['label'] = ['f1', 'recall', 'precision']
        renew_df.set_index('label', inplace=True)
        no_df = pd.DataFrame.from_dict(df['not_renewed'])
        no_df.columns = ['not_renwed']
        no_df['label'] = ['f1', 'recall', 'precision']
        no_df.set_index('label', inplace=True)
        confusion = pd.concat([renew_df, no_df], axis=1)
        accu = pd.DataFrame(df['accuracy'])
        accu.columns = ['accuracy']
        accu['label'] = ['train', 'validation']
        accu.set_index('label', inplace=True)
        return confusion, accu
def convert_for_output ( df ) : renew_df = pd . DataFrame . from_dict ( df [ 'renewed' ] ) renew_df . columns = [ 'renwed' ] renew_df [ 'label' ] = [ 'f1' , 'recall' , 'precision' ] renew_df . set_index ( 'label' , inplace = True ) no_df = pd . DataFrame . from_dict ( df [ 'not_renewed' ] ) no_df . columns = [ 'not_renwed' ] no_df [ 'label' ] = [ 'f1' , 'recall' , 'precision' ] no_df . set_index ( 'label' , inplace = True ) confusion = pd . concat ( [ renew_df , no_df ] , axis = 1 ) accu = pd . DataFrame ( df [ 'accuracy' ] ) accu . columns = [ 'accuracy' ] accu [ 'label' ] = [ 'train' , 'validation' ] accu . set_index ( 'label' , inplace = True ) return confusion , accu
This function convert the output of evaluate model
to more concise form.
This function convert the output of evaluate model to more concise form .
"""
        This function convert the output of evaluate model
        to more concise form. It will return a confusion matrix
        and an accuracy matrix
        """
df