def boxplot_accuracies(filenames): values = [] names = [] for i, filename in enumerate(filenames): ms = metrics.get_valid_metrics(metrics.load(filename)) values.append([m['acc'] for m in ms]) names.append("Exp {0}".format(i)) metrics.boxplot('Experiments', 'Accuracy', names, values).show()
def plot_confusion_matrix(filename, normalize): """Plot confusion matrix.""" m = metrics.aggregate(metrics.load(filename)) if normalize: m = metrics.normalize_confusion_matrix(m) metrics.plot_confusion_matrix(m).show()
def plot_loss(run_number, filename): """Plot loss.""" metrics.plot_loss(metrics.load(filename)[run_number]).show()
def plot_accuracy(run_number, filename): """Plot accuracy.""" metrics.plot_accuracy(metrics.load(filename)[run_number]).show()
def show_all(filenames): """Show all metrics.""" for filename in filenames: print("##### {0}\n".format(filename)) metrics.show(metrics.aggregate(metrics.load(filename)))