示例#1
0
def process_OOD(file_name):
    name = os.path.basename(file_name).split(".")[0]
    print("### " + name)
    print("```")
    model = Model(file_name)
    de = DE(model)
    stat = de.run()
    print("Time Taken : ", stat.runtime)
    stat.tiles()
    data_map = stat.median_spread()
    objs = stat.spit_objectives()
    headers = [obj.__name__.split("_")[-1] for obj in de.settings.obj_funcs]
    cluster_input = [headers] + objs
    print("")
    g = KMeans(k=2)
    clusters = g.run(cluster_input)
    med_spread_plot(data_map, headers, fig_name="img/gen_bin_" + name)
    plot_clusters(clusters,
                  fig_name="img/bin_" + name,
                  col_names=headers,
                  s=50,
                  edgecolors='none')
    print("```")
    print("![1](../../src/img/gen_bin_%s.png)" % name)
    return stat.runtime
示例#2
0
 def report(self, stats, sub_folder, fig_name):
     #headers = [obj.__name__.split("_")[-1] for obj in self.de.settings.obj_funcs]
     headers = ["softgoals", "goals", "costs"]
     med_spread_plot(stats,
                     headers,
                     fig_name="img/" + sub_folder + "/" + fig_name + ".png")
     return "img/" + sub_folder + "/" + fig_name + ".png"
示例#3
0
文件: star1.py 项目: spati2/softgoals
 def report(self, stats):
     headers = [
         obj.__name__.split("_")[-1] for obj in self.de.settings.obj_funcs
     ]
     med_spread_plot(stats,
                     headers,
                     fig_name="img/costs/" + self.model.get_tree().name +
                     ".png")
示例#4
0
文件: runner.py 项目: ai-se/softgoals
def process_ood(file_name):
  name = os.path.basename(file_name).split(".")[0]
  print("### " + name)
  print("```")
  model = Model(file_name)
  de = DE(model)
  stat = de.run()
  print("Time Taken : ", stat.runtime)
  stat.tiles()
  data_map = stat.median_spread()
  objs = stat.spit_objectives()
  headers = [obj.__name__.split("_")[-1] for obj in de.settings.obj_funcs]
  cluster_input = [headers] + objs
  print("")
  g = KMeans(k=2)
  clusters = g.run(cluster_input)
  med_spread_plot(data_map, headers, fig_name="img/gen_bin_"+name)
  plot_clusters(clusters,
                fig_name="img/bin_"+name,
                col_names=headers,
                s=50, edgecolors='none')
  print("```")
  print("![1](../../src/img/gen_bin_%s.png)"%name)
  return stat.runtime
示例#5
0
文件: star1.py 项目: ai-se/softgoals
 def report(self, stats, sub_folder, fig_name):
   #headers = [obj.__name__.split("_")[-1] for obj in self.de.settings.obj_funcs]
   headers = ["root cost", "root benefit", "softgoals", "preset decisions cost"]
   headers = ["root cost", "root benefit", "softgoals"]
   med_spread_plot(stats, headers, fig_name="img/"+sub_folder+"/"+fig_name+".png")
   return "img/"+sub_folder+"/"+fig_name+".png"