Spaces:
Configuration error
Configuration error
| # utils/grace_plot.py | |
| import pandas as pd | |
| from evaluate.visualization import radar_plot | |
| def plot_radar(): | |
| scores = { | |
| "Model A": [4.0, 4.5, 3.5, 4.0], | |
| "Model B": [3.5, 4.0, 4.0, 3.5] | |
| } | |
| labels = ["Generalization", "Relevance", "Artistry", "Efficiency"] | |
| df = pd.DataFrame(scores, index=labels).T | |
| data = [] | |
| for model in df.index: | |
| data.append({label: df.loc[model, label] for label in df.columns}) | |
| fig = radar_plot(data=data, model_names=list(df.index)) | |
| fig.suptitle("GRACE 模型评估对比图", fontsize=14) | |
| return fig |