def print_cm(cm, labels, hide_zeroes=False, hide_diagonal=False, hide_threshold=None):
columnwidth = max([len(x) for x in labels] + [<NUM_LIT:5>])  <EOL>empty_cell = "<STR_LIT:U+0020>" * columnwidth<EOL>print("<STR_LIT:U+0020>" + empty_cell, end="<STR_LIT:U+0020>")<EOL>for label in labels:<EOL><INDENT>print("<STR_LIT>".format(columnwidth) % label, end="<STR_LIT:U+0020>")<EOL><DEDENT>print()<EOL>for i, label1 in enumerate(labels):<EOL><INDENT>print("<STR_LIT>".format(columnwidth) % label1, end="<STR_LIT:U+0020>")<EOL>for j in range(len(labels)):<EOL><INDENT>cell = "<STR_LIT>".format(columnwidth) % cm[i, j]<EOL>if hide_zeroes:<EOL><INDENT>cell = cell if float(cm[i, j]) != <NUM_LIT:0> else empty_cell<EOL><DEDENT>if hide_diagonal:<EOL><INDENT>cell = cell if i != j else empty_cell<EOL><DEDENT>if hide_threshold:<EOL><INDENT>cell = cell if cm[i, j] > hide_threshold else empty_cell<EOL><DEDENT>print(cell, end="<STR_LIT:U+0020>")<EOL><DEDENT>print()<EOL><DEDENT>
pretty print for confusion matrixes