rosacastillo
commited on
Commit
·
c61a1f8
1
Parent(s):
773af00
Adjusting tools accuracy graphs
Browse files- app.py +1 -1
- tabs/tool_accuracy.py +24 -3
- tabs/trades.py +0 -1
app.py
CHANGED
@@ -381,7 +381,7 @@ with demo:
|
|
381 |
)
|
382 |
with gr.Row():
|
383 |
gr.Markdown(
|
384 |
-
"The data used for this metric is from the past two months. This metric is computed using both the tool accuracy and the volume of requests received by the tool"
|
385 |
)
|
386 |
with gr.Row():
|
387 |
_ = plot_tools_weighted_accuracy_graph(tools_accuracy_info)
|
|
|
381 |
)
|
382 |
with gr.Row():
|
383 |
gr.Markdown(
|
384 |
+
"The data used for this metric is from the past two months. This metric is computed using both the tool accuracy and the volume of requests received by the tool. The minimum value of this custom metric is 0 and the maximum value is 1. The higher the better is the tool."
|
385 |
)
|
386 |
with gr.Row():
|
387 |
_ = plot_tools_weighted_accuracy_graph(tools_accuracy_info)
|
tabs/tool_accuracy.py
CHANGED
@@ -8,6 +8,21 @@ VOLUME_FACTOR_REGULARIZATION = 0.5
|
|
8 |
UNSCALED_WEIGHTED_ACCURACY_INTERVAL = (-0.5, 100.5)
|
9 |
SCALED_WEIGHTED_ACCURACY_INTERVAL = (0, 1)
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
def scale_value(
|
13 |
value: float,
|
@@ -56,8 +71,11 @@ def plot_tools_accuracy_graph(tools_accuracy_info: pd.DataFrame):
|
|
56 |
y="tool",
|
57 |
hue="tool",
|
58 |
dodge=False,
|
59 |
-
palette=
|
60 |
)
|
|
|
|
|
|
|
61 |
return gr.Plot(value=plot.get_figure())
|
62 |
|
63 |
|
@@ -66,7 +84,7 @@ def plot_tools_weighted_accuracy_graph(tools_accuracy_info: pd.DataFrame):
|
|
66 |
by="weighted_accuracy", ascending=False
|
67 |
)
|
68 |
# Create the Seaborn bar plot
|
69 |
-
sns.set_theme(palette="viridis")
|
70 |
plt.figure(figsize=(25, 10))
|
71 |
plot = sns.barplot(
|
72 |
tools_accuracy_info,
|
@@ -74,6 +92,9 @@ def plot_tools_weighted_accuracy_graph(tools_accuracy_info: pd.DataFrame):
|
|
74 |
y="tool",
|
75 |
hue="tool",
|
76 |
dodge=False,
|
|
|
77 |
)
|
78 |
-
|
|
|
|
|
79 |
return gr.Plot(value=plot.get_figure())
|
|
|
8 |
UNSCALED_WEIGHTED_ACCURACY_INTERVAL = (-0.5, 100.5)
|
9 |
SCALED_WEIGHTED_ACCURACY_INTERVAL = (0, 1)
|
10 |
|
11 |
+
# tools palette as dictionary
|
12 |
+
tools_palette = {
|
13 |
+
"prediction-request-reasoning": "darkorchid",
|
14 |
+
"claude-prediction-offline": "rebeccapurple",
|
15 |
+
"prediction-request-reasoning-claude": "slateblue",
|
16 |
+
"prediction-request-rag-claude": "steelblue",
|
17 |
+
"prediction-online": "darkcyan",
|
18 |
+
"prediction-offline": "mediumaquamarine",
|
19 |
+
"claude-prediction-online": "mediumseagreen",
|
20 |
+
"prediction-online-sme": "yellowgreen",
|
21 |
+
"prediction-url-cot-claude": "gold",
|
22 |
+
"prediction-offline-sme": "orange",
|
23 |
+
"prediction-request-rag": "chocolate",
|
24 |
+
}
|
25 |
+
|
26 |
|
27 |
def scale_value(
|
28 |
value: float,
|
|
|
71 |
y="tool",
|
72 |
hue="tool",
|
73 |
dodge=False,
|
74 |
+
palette=tools_palette,
|
75 |
)
|
76 |
+
plt.xlabel("Mech tool_accuracy (%)", fontsize=20)
|
77 |
+
plt.ylabel("tool", fontsize=20)
|
78 |
+
plt.tick_params(axis="y", labelsize=12)
|
79 |
return gr.Plot(value=plot.get_figure())
|
80 |
|
81 |
|
|
|
84 |
by="weighted_accuracy", ascending=False
|
85 |
)
|
86 |
# Create the Seaborn bar plot
|
87 |
+
# sns.set_theme(palette="viridis")
|
88 |
plt.figure(figsize=(25, 10))
|
89 |
plot = sns.barplot(
|
90 |
tools_accuracy_info,
|
|
|
92 |
y="tool",
|
93 |
hue="tool",
|
94 |
dodge=False,
|
95 |
+
palette=tools_palette,
|
96 |
)
|
97 |
+
plt.xlabel("Weighted accuracy metric", fontsize=20)
|
98 |
+
plt.ylabel("tool", fontsize=20)
|
99 |
+
plt.tick_params(axis="y", labelsize=12)
|
100 |
return gr.Plot(value=plot.get_figure())
|
tabs/trades.py
CHANGED
@@ -73,7 +73,6 @@ def get_overall_winning_by_market_trades(trades_df: pd.DataFrame) -> pd.DataFram
|
|
73 |
winning_trades = winning_trades.reset_index()
|
74 |
winning_trades.columns = winning_trades.columns.astype(str)
|
75 |
winning_trades.columns = ["month_year_week", "market_creator", "winning_trade"]
|
76 |
-
print(winning_trades.head())
|
77 |
return winning_trades
|
78 |
|
79 |
|
|
|
73 |
winning_trades = winning_trades.reset_index()
|
74 |
winning_trades.columns = winning_trades.columns.astype(str)
|
75 |
winning_trades.columns = ["month_year_week", "market_creator", "winning_trade"]
|
|
|
76 |
return winning_trades
|
77 |
|
78 |
|