Compare commits
No commits in common. "1ee4b4103dcd452263c0139387a16bba801375d8" and "bdaba18487e6b3328df58f7ec15758c4bb321f62" have entirely different histories.
1ee4b4103d
...
bdaba18487
@ -8,6 +8,7 @@ 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'])
|
||||
@ -32,13 +33,11 @@ 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'])
|
||||
|
||||
new_row = pd.DataFrame([{'top_1_accuracy': np.mean(top_1_accuracy.numpy()), 'top_5_accuracy': np.mean(top_5_accuracy.numpy())}])
|
||||
metrics_df = pd.concat([metrics_df, new_row], ignore_index=True)
|
||||
metrics_df = metrics_df.concat({'top_1_accuracy': np.mean(top_1_accuracy), 'top_5_accuracy': np.mean(top_5_accuracy)}, 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')
|
||||
plt.savefig('plot.png')
|
Loading…
Reference in New Issue
Block a user