Ejemplo n.º 1
0
}

#eval_results = {
#    'accuracy': model.history.history["val_acc"],
#    'loss': model.history.history["val_loss"],
#    }

title = "TensorFlow (4 layers weights smote)"
save_path = "C:/Users/thoma/source/repos/PythonMachineLearning/PythonMachineLearning/Library/Results"
print('Analyzing...')
evaluator = Evaluator(title, save_path)
evaluator.append_to_file(f'Best iteration: {callback[0].best_epoch}',
                         "info.txt")
#evaluator.append_to_file(f'Best iteration: {len(model.history.history["val_loss"])}', "info.txt")
evaluator.append_to_file(f'Training time (seconds): {elapsed_time_training}',
                         "info.txt")
evaluator.append_to_file(f'Testing time (seconds): {elapsed_time_testing}',
                         "info.txt")
evaluator.save_dict_to_file(dataset_parameters, "dataset_parameters.csv")
evaluator.save_dict_to_file(model_parameters, "model_parameters.csv")
evaluator.save_advanced_metrics(dataset.y_test, y_pred, dataset.class_labels,
                                dataset.class_descriptions)
evaluator.save_eval_scores_to_file(eval_results, "metric_results.csv")
evaluator.create_evaluation_metric_results(eval_results,
                                           xlabel='epochs',
                                           ylabel='metric score')
evaluator.create_confusion_matrix(dataset.y_test,
                                  y_pred,
                                  dataset.class_labels,
                                  normalize=True)
plt.show()