Exemplo n.º 1
0
	def __plot_classification_report(self, y_test_pred):
		test_report = classification_report(self.__y_test, y_test_pred, output_dict=True)  # dict
		if self.__testing_mode is False:
			testing_report_as_array = self.__helper_plot_classification_report(test_report)
			self.__experiment.log_chart("Test Set - Classification Report", data=Heatmap(z=testing_report_as_array), y_ticks=self.__labels, x_ticks=["precision", "recall", "f1-score", "support"])
		else:
			print(test_report)
Exemplo n.º 2
0
	def __plot_confusion_matrix(self, y_test_pred=None):
		if self.__y_test is not None and y_test_pred is not None:
			confusion_mat_test = confusion_matrix(self.__y_test, y_test_pred)  # array
			confusion_mat_test = self.__helper_plot_confusion_matrix(confusion_mat_test)
			if self.__testing_mode is False:
				self.__experiment.log_chart("Test Set - confusion matrix", data=Heatmap(z=confusion_mat_test))
			else:
				print(confusion_mat_test)
Exemplo n.º 3
0
 def __plot_confusion_matrix(self, labels, predictions):
     """ Plots the confusion matrix. """
     confusion_mat_test = confusion_matrix(labels, predictions)  # array
     confusion_mat_test = TensorflowTrainer.__helper_plot_confusion_matrix(
         confusion_mat_test,
         mat_x_ticks=self.__classes,
         mat_y_ticks=self.__classes)
     self.__experiment.log_chart("confusion matrix",
                                 data=Heatmap(z=confusion_mat_test))