def _init_dict(self, conf):
     import pcresult
     l_result = pcresult.results(conf)
     if self.method == "count":
         self.clsobj = _ClassifierOfCount(l_result, self.threshold)
     elif self.method == "count_ighost":
         self.clsobj = _ClassifierOfCountIgHost(l_result, self.threshold)
     elif self.method == "cont":
         areas = pcresult.result_areas(conf)
         self.clsobj = _ClassifierOfContinuation(l_result,
                 self.threshold, areas)
     elif self.method == "cont_ighost":
         areas = pcresult.result_areas(conf)
         self.clsobj = _ClassifierOfContinuationIgHost(l_result,
                 self.threshold, areas)
 def _init_dict(self, conf):
     import pcresult
     l_result = pcresult.results(conf)
     if self.method == "count":
         self.clsobj = _ClassifierOfCount(l_result, self.threshold)
     elif self.method == "count_ighost":
         self.clsobj = _ClassifierOfCountIgHost(l_result, self.threshold)
     elif self.method == "cont":
         areas = pcresult.result_areas(conf)
         self.clsobj = _ClassifierOfContinuation(l_result, self.threshold,
                                                 areas)
     elif self.method == "cont_ighost":
         areas = pcresult.result_areas(conf)
         self.clsobj = _ClassifierOfContinuationIgHost(
             l_result, self.threshold, areas)
Exemple #3
0
def test_dag_search(conf, method, area = None):
    import cg_dag
    if method is None:
        method = conf.get("search", "method")

    src_dir = conf.get("dag", "output_dir")
    if area is None:
        l_area = pcresult.result_areas(conf)
    else:
        l_area = [area]
    for area in l_area:
        l_r = pcresult.results_in_area(conf, src_dir, area)
        result = []
        for r in l_r:
            if method == "log":
                result = similar_block_log(conf, r.top_dt, r.end_dt, r.area,
                        ignore_same = True)
            elif method in ("dag_ed", "dag_mcs"):
                result = cg_dag.similar_block_dag(conf, r.top_dt, r.end_dt,
                        r.area, method, ignore_same = True)
            else:
                raise NotImplementedError
            print r.cond_str()
            if len(result) > 10:
                result = ex_sorted(result,
                        key = lambda x: x[1], reverse = False)[:10]
            for r_found, val in result:
                print val, r_found.cond_str() 
            print
Exemple #4
0
def test_init_searchobj(conf):
    l_area = pcresult.result_areas(conf)
    for area in l_area:
        dagc = DAGComparison(conf, area)
        dagc.dump()