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)
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)
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
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
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)
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()
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
#! /Users/rkrsn/miniconda/bin/python
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