reproduce / plotting /print_incorrect.py
Attila Simkó
big upgrade
2db37b1
import plotly.express as px
import pandas as pd
import re
# Define columns for all relevant predictions
pred_columns = ['pred_dependencies', 'pred_training',
'pred_evaluation', 'pred_weights', 'pred_readme',
'pred_license']
# Define the real and predicted column pairs
real_pred_columns = {
'dependencies': 'pred_dependencies',
'training': 'pred_training',
'evaluation': 'pred_evaluation',
'weights': 'pred_weights',
'readme': 'pred_readme',
'license': 'pred_license'
}
df = pd.read_csv('data/results.csv', sep="\t")
# Cleanup
df['year'] = pd.to_numeric(df['year'], errors='coerce')
df = df.dropna(subset=['year'])
df['year'] = df['year'].astype(int)
custom_order = ["MICCAI", "MIDL", "Nature", "arXiv"]
# Group by venue
df_filtered = df[df['pred_live'] == "Yes"].copy()
df_filtered['license'] = df_filtered['license'].apply(lambda row: row if ((row == "No") | (pd.isna(row))) else "Yes")
# Add matching counts for each category
for real, pred in real_pred_columns.items():
df_filtered[f'matching_{real}'] = df_filtered[real] == df_filtered[pred]
for real, pred in real_pred_columns.items():
print(f"Evaluations for {real}:")
for idx, row in df_filtered.iterrows():
if ((row['year'] == 2024) | pd.isna(row["url"]) | (row["url"] == "") | (pd.isna(row[real]))):
continue
if not(row[f'matching_{real}']):
print(f"Automated test for {real} failed for link: {row['url']} [{row[real]} - {row[pred]}]")