Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import os
|
|
7 |
import json
|
8 |
import yaml
|
9 |
import matplotlib.pyplot as plt
|
|
|
10 |
|
11 |
from src.about import *
|
12 |
from src.bin.PROBE import run_probe
|
@@ -19,21 +20,24 @@ def get_baseline_df(selected_methods, selected_metrics):
|
|
19 |
df = df[df['method_name'].isin(selected_methods)][present_columns]
|
20 |
return df
|
21 |
|
22 |
-
# Function to create the plot
|
23 |
def create_plot(methods_selected, x_metric, y_metric):
|
24 |
df = pd.read_csv(CSV_RESULT_PATH)
|
25 |
-
filtered_df = df[df['
|
26 |
-
|
27 |
-
# Create a
|
28 |
-
plt.figure(figsize=(10, 8)) # Increase
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
|
|
|
33 |
plt.xlabel(x_metric)
|
34 |
plt.ylabel(y_metric)
|
35 |
plt.title(f'{y_metric} vs {x_metric} for selected methods')
|
36 |
-
plt.legend()
|
37 |
plt.grid(True)
|
38 |
|
39 |
# Save the plot to display it in Gradio
|
|
|
7 |
import json
|
8 |
import yaml
|
9 |
import matplotlib.pyplot as plt
|
10 |
+
import seaborn as sns
|
11 |
|
12 |
from src.about import *
|
13 |
from src.bin.PROBE import run_probe
|
|
|
20 |
df = df[df['method_name'].isin(selected_methods)][present_columns]
|
21 |
return df
|
22 |
|
|
|
23 |
def create_plot(methods_selected, x_metric, y_metric):
|
24 |
df = pd.read_csv(CSV_RESULT_PATH)
|
25 |
+
filtered_df = df[df['Method'].isin(methods_selected)]
|
26 |
+
|
27 |
+
# Create a Seaborn lineplot with method as hue
|
28 |
+
plt.figure(figsize=(10, 8)) # Increase figure size
|
29 |
+
sns.lineplot(
|
30 |
+
data=filtered_df,
|
31 |
+
x=x_metric,
|
32 |
+
y=y_metric,
|
33 |
+
hue="Method", # Different colors for different methods
|
34 |
+
marker="o", # Add markers to the line plot
|
35 |
+
)
|
36 |
|
37 |
+
# Add labels and title
|
38 |
plt.xlabel(x_metric)
|
39 |
plt.ylabel(y_metric)
|
40 |
plt.title(f'{y_metric} vs {x_metric} for selected methods')
|
|
|
41 |
plt.grid(True)
|
42 |
|
43 |
# Save the plot to display it in Gradio
|