giseldo commited on
Commit
95834fd
·
1 Parent(s): 4240c73

ultima versao

Browse files
Files changed (2) hide show
  1. app.py +10 -13
  2. requirements.txt +1 -4
app.py CHANGED
@@ -6,35 +6,32 @@ import numpy as np
6
  LIBRARIES = ["ALOY", "APSTUD", "CLI", "TIMOB", "XD"]
7
 
8
  def grafico(list_output_mean, list_output_neosp, nome_projeto, pip_choices):
9
- list_output_mean = [3.152778, 3.375000, 1.423820, 1.052039, 1.297747, 1.224785, 2.250000, 2.375000, 1.540773, 1.847639, 1.491953, 1.052039, 0.983369, 1.669528,
10
- 1.665236, 1.412554, 1.375000, 1.078326, 1.556330, 1.625000, 1.860515, 1.491953, 1.160944, 1.675966, 1.987661, 2.369099, 1.431867, 1.944742, 2.329399, 1.925429]
11
- list_output_NEOSP = [3.191631, 3.417342, 1.202562, 0.867979, 1.225224, 1.028501, 2.165318, 2.291910, 1.141041, 1.785504, 1.086850, 0.875381, 0.714992, 1.604599,
12
- 1.833541, 0.860600, 1.393656, 1.152935, 1.364006, 1.647414, 1.527748, 1.236909, 1.403306, 1.655692, 1.770828, 1.937058, 0.861534, 1.341726, 1.904503, 1.449757]
13
- list_results = [["Median Regressor", np.mean(list_output_mean)], [
14
- "NEOSP-SVR Regressor", np.mean(list_output_NEOSP)]]
15
  fig, (ax1, ax2) = plt.subplots(1, 2)
16
  # ax1
17
- if "Median Regressor" in pip_choices:
18
  df_list_output_mean = pd.DataFrame(list_output_mean, columns=["MAE"])
19
  ax1.plot(df_list_output_mean.index,
20
- df_list_output_mean["MAE"], label="Median Regressor")
21
  if "NEOSP-SVR Regressor" in pip_choices:
22
- df_list_output_NEOSP = pd.DataFrame(list_output_NEOSP, columns=["MAE"])
23
  ax1.plot(df_list_output_NEOSP.index,
24
  df_list_output_NEOSP["MAE"], label="NEOSP-SVR Regressor")
25
  ax1.set_xlabel("Index Execução")
26
  ax1.set_ylabel("MAE")
27
  ax1.legend()
28
  # ax2
29
- if "Median Regressor" or "NEOSP-SVR Regressor" in pip_choices:
30
  df = pd.DataFrame(list_results, columns=["Model", "MAE"])
31
- if "Median Regressor" in pip_choices:
32
  ax2.bar(df["Model"].iloc[[0]], df["MAE"].iloc[[0]])
33
  if "NEOSP-SVR Regressor" in pip_choices:
34
  ax2.bar(df["Model"].iloc[[1]], df["MAE"].iloc[[1]])
35
  if "NEOSP-SVR Regressor" and "NEOSP-SVR Regressor" in pip_choices:
36
  ax2.bar(df["Model"], df["MAE"])
37
- if "Median Regressor" or "NEOSP-SVR Regressor" in pip_choices:
38
  ax2.set_ylabel("MAE Médio")
39
  ax2.set_xlabel("Modelos")
40
  # graficos geral
@@ -82,7 +79,7 @@ with gr.Blocks() as demo:
82
  with gr.Column():
83
  gr.Markdown("## Gráficos")
84
  pip = gr.CheckboxGroup(
85
- choices=["Median Regressor", "NEOSP-SVR Regressor"], label="Modelos Preditivos")
86
  # stars = gr.CheckboxGroup(choices=["Stars", "Week over Week"], label="")
87
  # issues = gr.CheckboxGroup(choices=["Issue", "Exclude org members", "week over week"], label="")
88
  with gr.Row():
 
6
  LIBRARIES = ["ALOY", "APSTUD", "CLI", "TIMOB", "XD"]
7
 
8
  def grafico(list_output_mean, list_output_neosp, nome_projeto, pip_choices):
9
+
10
+ list_results = [["MbR Regressor", np.mean(list_output_mean)], [
11
+ "NEOSP-SVR Regressor", np.mean(list_output_neosp)]]
 
 
 
12
  fig, (ax1, ax2) = plt.subplots(1, 2)
13
  # ax1
14
+ if "MbR Regressor" in pip_choices:
15
  df_list_output_mean = pd.DataFrame(list_output_mean, columns=["MAE"])
16
  ax1.plot(df_list_output_mean.index,
17
+ df_list_output_mean["MAE"], label="MbR Regressor")
18
  if "NEOSP-SVR Regressor" in pip_choices:
19
+ df_list_output_NEOSP = pd.DataFrame(list_output_neosp, columns=["MAE"])
20
  ax1.plot(df_list_output_NEOSP.index,
21
  df_list_output_NEOSP["MAE"], label="NEOSP-SVR Regressor")
22
  ax1.set_xlabel("Index Execução")
23
  ax1.set_ylabel("MAE")
24
  ax1.legend()
25
  # ax2
26
+ if "MbR Regressor" or "NEOSP-SVR Regressor" in pip_choices:
27
  df = pd.DataFrame(list_results, columns=["Model", "MAE"])
28
+ if "MbR Regressor" in pip_choices:
29
  ax2.bar(df["Model"].iloc[[0]], df["MAE"].iloc[[0]])
30
  if "NEOSP-SVR Regressor" in pip_choices:
31
  ax2.bar(df["Model"].iloc[[1]], df["MAE"].iloc[[1]])
32
  if "NEOSP-SVR Regressor" and "NEOSP-SVR Regressor" in pip_choices:
33
  ax2.bar(df["Model"], df["MAE"])
34
+ if "MbR Regressor" or "NEOSP-SVR Regressor" in pip_choices:
35
  ax2.set_ylabel("MAE Médio")
36
  ax2.set_xlabel("Modelos")
37
  # graficos geral
 
79
  with gr.Column():
80
  gr.Markdown("## Gráficos")
81
  pip = gr.CheckboxGroup(
82
+ choices=["MbR Regressor", "NEOSP-SVR Regressor"], label="Modelos Preditivos")
83
  # stars = gr.CheckboxGroup(choices=["Stars", "Week over Week"], label="")
84
  # issues = gr.CheckboxGroup(choices=["Issue", "Exclude org members", "week over week"], label="")
85
  with gr.Row():
requirements.txt CHANGED
@@ -1,4 +1 @@
1
- matplotlib
2
- gradio
3
- pandas
4
- numpy
 
1
+ matplotlib