def result_report_class_wise(self):
        """Report class-wise results

        Returns
        -------
        str
            result report in string format

        """

        results = self.results_class_wise_metrics()

        accuracy_present = True
        for event_label in self.event_label_list:
            if 'accuracy' not in results[event_label]['accuracy']:
                accuracy_present = False

        output = self.ui.section_header('Class-wise metrics', indent=2) + '\n'

        headers = ['Event label', 'Nref', 'Nsys', 'F', 'Pre', 'Rec', 'ER', 'Del', 'Ins']
        sep = ['-', '-', '-', '-', '-', '-', '-', '-', '-']
        widths = [15, 8, 8, 9, 9, 9, 9, 9, 9]
        separators = [True, False, True, False, False, True, False, False, True]
        if accuracy_present:
            headers += ['Sens', 'Spec', 'Bacc', 'Acc']
            sep += ['-', '-', '-', '-']
            widths += [9, 9, 9, 9]
            separators += [False, False, False, False]

        output += self.ui.row(*headers, widths=widths, indent=4, separators=separators) + '\n'
        output += self.ui.row(*sep) + '\n'
        for event_label in self.event_label_list:
            data = [
                event_label,
                results[event_label]['count']['Nref'],
                results[event_label]['count']['Nsys'],
                results[event_label]['f_measure']['f_measure'] * 100,
                results[event_label]['f_measure']['precision'] * 100,
                results[event_label]['f_measure']['recall'] * 100,
                results[event_label]['error_rate']['error_rate'],
                results[event_label]['error_rate']['deletion_rate'],
                results[event_label]['error_rate']['insertion_rate']
            ]

            types = [
                'str15',
                'int',
                'int',
                'float1_percentage',
                'float1_percentage',
                'float1_percentage',
                'float2',
                'float2',
                'float2',
            ]

            if accuracy_present:
                data += [
                    results[event_label]['accuracy']['sensitivity'] * 100,
                    results[event_label]['accuracy']['specificity'] * 100,
                    results[event_label]['accuracy']['balanced_accuracy'] * 100,
                    results[event_label]['accuracy']['accuracy'] * 100
                ]

                types += [
                    'float1_percentage',
                    'float1_percentage',
                    'float1_percentage',
                    'float1_percentage',
                ]

            output += self.ui.row(*data, types=types) + '\n'

        return output
def result_report_class_wise ( self ) : results = self . results_class_wise_metrics ( ) accuracy_present = True for event_label in self . event_label_list : if 'accuracy' not in results [ event_label ] [ 'accuracy' ] : accuracy_present = False output = self . ui . section_header ( 'Class-wise metrics' , indent = 2 ) + '\n' headers = [ 'Event label' , 'Nref' , 'Nsys' , 'F' , 'Pre' , 'Rec' , 'ER' , 'Del' , 'Ins' ] sep = [ '-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' ] widths = [ 15 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 ] separators = [ True , False , True , False , False , True , False , False , True ] if accuracy_present : headers += [ 'Sens' , 'Spec' , 'Bacc' , 'Acc' ] sep += [ '-' , '-' , '-' , '-' ] widths += [ 9 , 9 , 9 , 9 ] separators += [ False , False , False , False ] output += self . ui . row ( * headers , widths = widths , indent = 4 , separators = separators ) + '\n' output += self . ui . row ( * sep ) + '\n' for event_label in self . event_label_list : data = [ event_label , results [ event_label ] [ 'count' ] [ 'Nref' ] , results [ event_label ] [ 'count' ] [ 'Nsys' ] , results [ event_label ] [ 'f_measure' ] [ 'f_measure' ] * 100 , results [ event_label ] [ 'f_measure' ] [ 'precision' ] * 100 , results [ event_label ] [ 'f_measure' ] [ 'recall' ] * 100 , results [ event_label ] [ 'error_rate' ] [ 'error_rate' ] , results [ event_label ] [ 'error_rate' ] [ 'deletion_rate' ] , results [ event_label ] [ 'error_rate' ] [ 'insertion_rate' ] ] types = [ 'str15' , 'int' , 'int' , 'float1_percentage' , 'float1_percentage' , 'float1_percentage' , 'float2' , 'float2' , 'float2' , ] if accuracy_present : data += [ results [ event_label ] [ 'accuracy' ] [ 'sensitivity' ] * 100 , results [ event_label ] [ 'accuracy' ] [ 'specificity' ] * 100 , results [ event_label ] [ 'accuracy' ] [ 'balanced_accuracy' ] * 100 , results [ event_label ] [ 'accuracy' ] [ 'accuracy' ] * 100 ] types += [ 'float1_percentage' , 'float1_percentage' , 'float1_percentage' , 'float1_percentage' , ] output += self . ui . row ( * data , types = types ) + '\n' return output
Report class-wise results

        Returns
        -------
        str
            result report in string format