rosacastillo commited on
Commit
2c3deb9
·
1 Parent(s): d22f353

trying table instead of barplot

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. tabs/invalid_markets.py +6 -16
app.py CHANGED
@@ -288,7 +288,7 @@ with demo:
288
  )
289
 
290
  with gr.Row():
291
- plot_tools_accuracy_graph(tools_accuracy_info)
292
 
293
  with gr.Row():
294
  gr.Markdown("# Weighted accuracy ranking per tool")
@@ -297,7 +297,7 @@ with demo:
297
  "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"
298
  )
299
  with gr.Row():
300
- plot_tools_weighted_accuracy_graph(tools_accuracy_info)
301
 
302
  with gr.TabItem("⛔ Invalid Markets Dashboard"):
303
  with gr.Row():
 
288
  )
289
 
290
  with gr.Row():
291
+ _ = plot_tools_accuracy_graph(tools_accuracy_info)
292
 
293
  with gr.Row():
294
  gr.Markdown("# Weighted accuracy ranking per tool")
 
297
  "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"
298
  )
299
  with gr.Row():
300
+ _ = plot_tools_weighted_accuracy_graph(tools_accuracy_info)
301
 
302
  with gr.TabItem("⛔ Invalid Markets Dashboard"):
303
  with gr.Row():
tabs/invalid_markets.py CHANGED
@@ -11,11 +11,12 @@ WIDTH = 1000
11
  def plot_daily_dist_invalid_trades(invalid_trades: pd.DataFrame):
12
  """Function to paint the distribution of daily invalid trades, no matter which market"""
13
  invalid_trades["creation_date"] = invalid_trades["creation_date"].astype(str)
 
14
  plot2 = sns.histplot(data=invalid_trades, x="creation_date", kde=True)
15
- # plt.title("Distribution of daily invalid trades over time")
16
- # plt.xlabel("Creation date")
17
- # plt.ylabel("Daily number of invalid trades")
18
- # plt.xticks(rotation=45, ha="right")
19
  daily_trades_fig = plot2.get_figure()
20
  return gr.Plot(value=daily_trades_fig)
21
 
@@ -67,15 +68,4 @@ def plot_top_invalid_markets(invalid_trades: pd.DataFrame):
67
  print(top_invalid_markets.head(5))
68
  top_invalid_markets = top_invalid_markets.head(5)
69
  top_invalid_markets.rename(columns={"count": "nr_invalid_trades"}, inplace=True)
70
- return gr.BarPlot(
71
- value=top_invalid_markets,
72
- x="nr_invalid_trades",
73
- y="title",
74
- x_title="Nr_invalid_trades",
75
- y_title="Market title",
76
- interactive=True,
77
- show_actions_button=True,
78
- tooltip=["title", "nr_invalid_trades"],
79
- height=HEIGHT,
80
- width=WIDTH,
81
- )
 
11
  def plot_daily_dist_invalid_trades(invalid_trades: pd.DataFrame):
12
  """Function to paint the distribution of daily invalid trades, no matter which market"""
13
  invalid_trades["creation_date"] = invalid_trades["creation_date"].astype(str)
14
+ plt.figure(figsize=(25, 10))
15
  plot2 = sns.histplot(data=invalid_trades, x="creation_date", kde=True)
16
+ plt.title("Distribution of daily invalid trades over time")
17
+ plt.xlabel("Creation date")
18
+ plt.ylabel("Daily number of invalid trades")
19
+ plt.xticks(rotation=45, ha="right")
20
  daily_trades_fig = plot2.get_figure()
21
  return gr.Plot(value=daily_trades_fig)
22
 
 
68
  print(top_invalid_markets.head(5))
69
  top_invalid_markets = top_invalid_markets.head(5)
70
  top_invalid_markets.rename(columns={"count": "nr_invalid_trades"}, inplace=True)
71
+ return gr.DataFrame(top_invalid_markets)