Ejemplo n.º 1
0
 def main(self, mode='defect', justDeltas=False):
   if mode == "defect":
     train_DF = createTbl(self.train, isBin=False)
     test_DF = createTbl(self.test, isBin=False)
     before = rforest(train=train_DF, test=test_DF)
     clstr = [c for c in self.nodes(train_DF._rows)]
     return patches(train=self.train,
                    test=self.test,
                    clusters=clstr,
                    prune=self.prune,
                    pred=before).newTable(justDeltas=justDeltas)
   elif mode == "models":
     train_DF = createTbl(self.train, isBin=False)
     test_DF = createTbl(self.test, isBin=False)
     before = rforest(train=train_DF, test=test_DF)
     clstr = [c for c in self.nodes(train_DF._rows)]
     return patches(train=self.train,
                    test=self.test,
                    clusters=clstr,
                    prune=self.prune,
                    models=True,
                    pred=before).newTable(justDeltas=justDeltas)
   elif mode == "config":
     train_DF = createTbl(self.train, isBin=False)
     test_DF = createTbl(self.test, isBin=False)
     before = rforest2(train=train_DF, test=test_DF)
     clstr = [c for c in self.nodes(train_DF._rows)]
     return patches(train=self.train,
                    test=self.test,
                    clusters=clstr,
                    name=self.name,
                    prune=self.prune,
                    pred=before,
                    config=True).newTable(justDeltas=justDeltas)
Ejemplo n.º 2
0
    def __init__(self,
                 train,
                 test,
                 clusters,
                 prune=False,
                 B=0.25,
                 verbose=False,
                 bin=False):
        if bin:
            self.train = createTbl(train, isBin=False)
            self.test = createTbl(test, isBin=False)
        else:
            self.train = createTbl(train, isBin=False)
            self.test = createTbl(test, isBin=True)

        self.clusters = clusters
        self.Prune = prune
        self.B = B
        self.mask = self.fWeight()
        self.write = verbose
        self.bin = bin
        if bin:
            self.pred = rforest2(self.train,
                                 self.test,
                                 smoteit=True,
                                 duplicate=True)
        else:
            self.pred = rforest(self.train,
                                self.test,
                                smoteit=True,
                                duplicate=True)
Ejemplo n.º 3
0
 def depen(self, rows):
     mod = rforest(
         self.train,
         self.test,
         tunings=rows  # n_est, max_feat, mss, msl
         ,
         smoteit=True)
     g = _Abcd(before=Bugs(self.test), after=mod, show=False)[-1]
     return g
Ejemplo n.º 4
0
 def __init__(
         self, train, test, clusters, prune=False, B=0.33, verbose=False):
   self.train = createTbl(train, isBin=True)
   self.test = createTbl(test, isBin=True)
   self.pred = rforest(self.train, self.test, smoteit=True, duplicate=True)
   self.clusters = clusters
   self.Prune = prune
   self.B = B
   self.mask = self.fWeight()
   self.write = verbose
Ejemplo n.º 5
0
 def main(self):
   train, test = run(dataName='ant').categorize()
   train_DF = createTbl(train[-1], isBin=True)
   test_DF = createTbl(test[-1], isBin=True)
   before = rforest(train=train_DF, test=test_DF)
   for _ in xrange(1):
     clstr = [c for c in self.nodes(train_DF._rows)]
     newTbl = patches(train=train[-1],
                      test=test[-1],
                      clusters=clstr).deltasCSVWriter(name=self.name)
Ejemplo n.º 6
0
 def main(self, config=False):
     if not config:
         train_DF = createTbl(self.train, isBin=False)
         test_DF = createTbl(self.test, isBin=False)
         before = rforest(train=train_DF, test=test_DF)
         clstr = [c for c in self.nodes(train_DF._rows)]
         return patches(train=self.train,
                        test=self.test,
                        clusters=clstr,
                        prune=self.prune).newTable()
     else:
         train_DF = createTbl(self.train, isBin=False)
         test_DF = createTbl(self.test, isBin=False)
         before = rforest2(train=train_DF, test=test_DF)
         clstr = [c for c in self.nodes(train_DF._rows)]
         return patches(train=self.train,
                        test=self.test,
                        clusters=clstr,
                        prune=self.prune,
                        bin=True).newTable()
Ejemplo n.º 7
0
 def main(self, config=False):
   if not config:
     train_DF = createTbl(self.train, isBin=False)
     test_DF = createTbl(self.test, isBin=False)
     before = rforest(train=train_DF, test=test_DF)
     clstr = [c for c in self.nodes(train_DF._rows)]
     return patches(train=self.train,
                    test=self.test,
                    clusters=clstr,
                    prune=self.prune).newTable()
   else:
     train_DF = createTbl(self.train, isBin=False)
     test_DF = createTbl(self.test, isBin=False)
     before = rforest2(train=train_DF, test=test_DF)
     clstr = [c for c in self.nodes(train_DF._rows)]
     return patches(train=self.train,
                    test=self.test,
                    clusters=clstr,
                    prune=self.prune,
                    bin=True).newTable()
Ejemplo n.º 8
0
 def depen(self, rows):
   mod = rforest(self.train, self.test, tunings=rows, smoteit=True)
   prec = ABCD(before=Bugs(self.test), after=mod).all()[2]
   pdpf = ABCD(before=Bugs(self.test), after=mod).all()[:2]
   return prec
Ejemplo n.º 9
0
#! /Users/rkrsn/miniconda/bin/python
Ejemplo n.º 10
0
Archivo: BIC.py Proyecto: ai-se/RAAT
#! /Users/rkrsn/miniconda/bin/python
Ejemplo n.º 11
0
 def depen(self, rows):
     mod = rforest(self.train, self.test, tunings=rows, smoteit=True)
     prec = ABCD(before=Bugs(self.test), after=mod).all()[2]
     pdpf = ABCD(before=Bugs(self.test), after=mod).all()[:2]
     return prec
Ejemplo n.º 12
0
 def depen(self, rows):
   mod = rforest(self.train, self.test
               , tunings = rows  # n_est, max_feat, mss, msl
               , smoteit = True)
   g = _Abcd(before = Bugs(self.test), after = mod, show = False)[-1]
   return g