giseldo commited on
Commit
8694ab2
·
1 Parent(s): 9faf1b7

ultima versao

Browse files
Files changed (1) hide show
  1. app.py +14 -16
app.py CHANGED
@@ -6,7 +6,6 @@ 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
-
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)
@@ -14,23 +13,26 @@ def grafico(list_output_mean, list_output_neosp, nome_projeto, pip_choices):
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")
@@ -43,20 +45,16 @@ def grafico(list_output_mean, list_output_neosp, nome_projeto, pip_choices):
43
 
44
  def create_pip_plot(libraries, pip_choices):
45
  if "ALOY" in libraries:
46
- list_output_ALOY_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,
47
- 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]
48
- list_output_ALOY_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,
49
- 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]
50
  return grafico(list_output_ALOY_mean, list_output_ALOY_NEOSP, "ALOY", pip_choices)
51
  elif "APSTUD" in libraries:
52
  list_output_APSTUD_mean = [5.405978260869565, 5.619565217391305, 4.4375, 4.580434782608696, 4.5, 3.5016304347826086, 1.945108695652174, 4.5, 6.836956521739131, 5.0, 3.1649456521739134, 3.309239130434783, 2.203804347826087, 3.007336956521739, 4.059782608695652, 3.296467391304348, 2.3084239130434785, 3.4937500000000004, 3.774456521739131, 3.7527173913043477, 5.465217391304348, 4.619565217391304, 4.6603260869565215, 3.0625, 2.0070652173913044, 3.059239130434783, 3.3274041937816334, 3.411279826464208, 3.7968185104844543, 8.73709327548807]
53
  list_output_APSTUD_NEOSP = [5.41661475603331, 5.503547725525665, 4.415931210782633, 4.545322877373284, 4.536777472583356, 3.362346453641618, 1.9843639160064401, 4.470861996846005, 6.7482924452454744, 5.030760970371084, 3.4920408655032915, 3.246151689153077, 2.279240264502646, 3.0146941161291476, 4.098301193482748, 3.3288198557025104, 2.3172072884716948, 3.54395454745025, 3.7937206634843017, 3.7337097584332075, 5.521106648217923, 4.657538991789229, 4.655121901790425, 3.030783487143312, 2.0003910449758164, 3.029204865355089, 3.4122658576760707, 3.362791681092995, 3.7584358231873463, 8.847135170166245]
54
  return grafico(list_output_APSTUD_mean, list_output_APSTUD_NEOSP, "APSTUD", pip_choices)
55
  elif "CLI" in libraries:
56
- list_output_CLI_mean = [3.073851590106007, 0.8678445229681978, 2.225088339222615, 2.574558303886926, 2.6738515901060067, 1.57773851590106, 1.4724381625441698, 2.221554770318021, 2.5, 1.2190812720848054, 1.6420494699646642, 1.871024734982332, 2.069611307420495, 1.5, 1.9703180212014133,
57
- 0.39081272084805657, 1.9996466431095405, 1.569257950530035, 1.4, 1.1144876325088338, 1.780565371024735, 0.9583038869257952, 1.63321554770318, 1.673317683881064, 2.0082159624413145, 1.9530516431924885, 2.335680751173709, 2.6815336463223787, 1.2699530516431925, 1.4428794992175273]
58
- list_output_CLI_NEOSP = [3.1538037286288505, 0.937225588342782, 2.1037834307438303, 2.7185375907916134, 2.705821416930853, 1.5651596557303535, 1.1630692970019907, 2.373780602244225, 2.642528080865694, 0.8917870166563835, 1.9119725116172384, 1.895509058775452, 2.2941219868278147, 1.5548661959529118,
59
- 2.018983040645479, 0.3002212060779503, 1.8850529066288408, 1.417942660377745, 1.3788045174949335, 1.0137659071118208, 1.4936335189563361, 0.82267957042595, 1.1580797095299311, 1.0556058690485837, 1.7453689640857384, 1.5028556447190604, 2.098886003603931, 2.7192884860222506, 1.1056835708897894, 1.4314289365223634]
60
  return grafico(list_output_CLI_mean, list_output_CLI_NEOSP, "CLI", pip_choices)
61
  elif "TIMOB" in libraries:
62
  list_output_TIMOB_mean = [3.1239187095524747, 3.1127719364782216, 2.558648911447154, 3.275111760244016, 2.7384507690073105, 2.8920827752045573, 3.2534940206252116, 2.50271533011636, 2.9008521214273033, 1.9765121927601954, 2.982737682165163, 2.2250455917240934, 2.531187967012572, 1.9724129722576376,2.572886238561722, 1.768976730007113, 1.9037841682755818, 1.9127182196931205, 2.2375632557666902, 2.007052128848694, 2.139313077939234, 1.9027192358500153, 1.9491901229549842, 2.4138766385529924, 2.830769230769231, 3.545076719845544, 2.7588862920434916, 2.4929051925617314, 2.0218412762930593, 1.7311899197236056]
 
6
  LIBRARIES = ["ALOY", "APSTUD", "CLI", "TIMOB", "XD"]
7
 
8
  def grafico(list_output_mean, list_output_neosp, nome_projeto, pip_choices):
 
9
  list_results = [["MbR Regressor", np.mean(list_output_mean)], [
10
  "NEOSP-SVR Regressor", np.mean(list_output_neosp)]]
11
  fig, (ax1, ax2) = plt.subplots(1, 2)
 
13
  if "MbR Regressor" in pip_choices:
14
  df_list_output_mean = pd.DataFrame(list_output_mean, columns=["MAE"])
15
  ax1.plot(df_list_output_mean.index,
16
+ df_list_output_mean["MAE"], label="MbR Regressor", color="red")
17
+ ax1.set
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", color="blue")
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
+
 
 
 
29
  if "NEOSP-SVR Regressor" and "NEOSP-SVR Regressor" in pip_choices:
30
+ ax2.bar(df["Model"], df["MAE"], color=["red", "blue"])
31
+ elif "MbR Regressor" in pip_choices:
32
+ ax2.bar(df["Model"].iloc[[0]], df["MAE"].iloc[[0]], color="red")
33
+ elif "NEOSP-SVR Regressor" in pip_choices:
34
+ ax2.bar(df["Model"].iloc[[1]], df["MAE"].iloc[[1]], color = "blue")
35
+
36
  if "MbR Regressor" or "NEOSP-SVR Regressor" in pip_choices:
37
  ax2.set_ylabel("MAE Médio")
38
  ax2.set_xlabel("Modelos")
 
45
 
46
  def create_pip_plot(libraries, pip_choices):
47
  if "ALOY" in libraries:
48
+ list_output_ALOY_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, 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]
49
+ list_output_ALOY_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, 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]
 
 
50
  return grafico(list_output_ALOY_mean, list_output_ALOY_NEOSP, "ALOY", pip_choices)
51
  elif "APSTUD" in libraries:
52
  list_output_APSTUD_mean = [5.405978260869565, 5.619565217391305, 4.4375, 4.580434782608696, 4.5, 3.5016304347826086, 1.945108695652174, 4.5, 6.836956521739131, 5.0, 3.1649456521739134, 3.309239130434783, 2.203804347826087, 3.007336956521739, 4.059782608695652, 3.296467391304348, 2.3084239130434785, 3.4937500000000004, 3.774456521739131, 3.7527173913043477, 5.465217391304348, 4.619565217391304, 4.6603260869565215, 3.0625, 2.0070652173913044, 3.059239130434783, 3.3274041937816334, 3.411279826464208, 3.7968185104844543, 8.73709327548807]
53
  list_output_APSTUD_NEOSP = [5.41661475603331, 5.503547725525665, 4.415931210782633, 4.545322877373284, 4.536777472583356, 3.362346453641618, 1.9843639160064401, 4.470861996846005, 6.7482924452454744, 5.030760970371084, 3.4920408655032915, 3.246151689153077, 2.279240264502646, 3.0146941161291476, 4.098301193482748, 3.3288198557025104, 2.3172072884716948, 3.54395454745025, 3.7937206634843017, 3.7337097584332075, 5.521106648217923, 4.657538991789229, 4.655121901790425, 3.030783487143312, 2.0003910449758164, 3.029204865355089, 3.4122658576760707, 3.362791681092995, 3.7584358231873463, 8.847135170166245]
54
  return grafico(list_output_APSTUD_mean, list_output_APSTUD_NEOSP, "APSTUD", pip_choices)
55
  elif "CLI" in libraries:
56
+ list_output_CLI_mean = [3.073851590106007, 0.8678445229681978, 2.225088339222615, 2.574558303886926, 2.6738515901060067, 1.57773851590106, 1.4724381625441698, 2.221554770318021, 2.5, 1.2190812720848054, 1.6420494699646642, 1.871024734982332, 2.069611307420495, 1.5, 1.9703180212014133, 0.39081272084805657, 1.9996466431095405, 1.569257950530035, 1.4, 1.1144876325088338, 1.780565371024735, 0.9583038869257952, 1.63321554770318, 1.673317683881064, 2.0082159624413145, 1.9530516431924885, 2.335680751173709, 2.6815336463223787, 1.2699530516431925, 1.4428794992175273]
57
+ list_output_CLI_NEOSP = [3.1538037286288505, 0.937225588342782, 2.1037834307438303, 2.7185375907916134, 2.705821416930853, 1.5651596557303535, 1.1630692970019907, 2.373780602244225, 2.642528080865694, 0.8917870166563835, 1.9119725116172384, 1.895509058775452, 2.2941219868278147, 1.5548661959529118, 2.018983040645479, 0.3002212060779503, 1.8850529066288408, 1.417942660377745, 1.3788045174949335, 1.0137659071118208, 1.4936335189563361, 0.82267957042595, 1.1580797095299311, 1.0556058690485837, 1.7453689640857384, 1.5028556447190604, 2.098886003603931, 2.7192884860222506, 1.1056835708897894, 1.4314289365223634]
 
 
58
  return grafico(list_output_CLI_mean, list_output_CLI_NEOSP, "CLI", pip_choices)
59
  elif "TIMOB" in libraries:
60
  list_output_TIMOB_mean = [3.1239187095524747, 3.1127719364782216, 2.558648911447154, 3.275111760244016, 2.7384507690073105, 2.8920827752045573, 3.2534940206252116, 2.50271533011636, 2.9008521214273033, 1.9765121927601954, 2.982737682165163, 2.2250455917240934, 2.531187967012572, 1.9724129722576376,2.572886238561722, 1.768976730007113, 1.9037841682755818, 1.9127182196931205, 2.2375632557666902, 2.007052128848694, 2.139313077939234, 1.9027192358500153, 1.9491901229549842, 2.4138766385529924, 2.830769230769231, 3.545076719845544, 2.7588862920434916, 2.4929051925617314, 2.0218412762930593, 1.7311899197236056]