From 5e19ff3ce831a5ceb6a1d4ee85a5d1f898ae1957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Zar=C4=99ba?= Date: Wed, 10 May 2023 19:07:41 +0200 Subject: [PATCH] s --- evaluate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evaluate.py b/evaluate.py index 0ff7238..247b1b5 100644 --- a/evaluate.py +++ b/evaluate.py @@ -8,7 +8,6 @@ import os model = tf.keras.models.load_model('model.h5') - test_data = pd.read_csv('data.csv', sep=';') test_data = pd.get_dummies(test_data, columns=['Sex', 'Medal']) test_data = test_data.drop(columns=['Name', 'Team', 'NOC', 'Games', 'Year', 'Season', 'City', 'Sport', 'Event']) @@ -33,11 +32,12 @@ if os.path.exists(metrics_file): metrics_df = pd.read_csv(metrics_file) else: metrics_df = pd.DataFrame(columns=['top_1_accuracy', 'top_5_accuracy']) -metrics_df = metrics_df.concat({'top_1_accuracy': np.mean(top_1_accuracy), 'top_5_accuracy': np.mean(top_5_accuracy)}, ignore_index=True) +new_row = pd.DataFrame({'top_1_accuracy': np.mean(top_1_accuracy), 'top_5_accuracy': np.mean(top_5_accuracy)}, index=[0]) +metrics_df = pd.concat([metrics_df, new_row], ignore_index=True) metrics_df.to_csv(metrics_file, index=False) plt.figure(figsize=(10, 6)) plt.plot(metrics_df['top_1_accuracy'], label='Top-1 Accuracy') plt.plot(metrics_df['top_5_accuracy'], label='Top-5 Accuracy') plt.legend() -plt.savefig('plot.png') \ No newline at end of file +plt.savefig('plot.png')