def eval(self, model): res = [] for gr, fname in [(self.gr, self.trainf), (self.grv, self.valf), (self.grt, self.testf)]: if gr is None: res.append(None) continue ypred = model.predict(gr)['score'] res.append(ev.eval_rte(ypred, gr['score'], fname)) return tuple(res)
def eval(self, model): res = [] for gr, fname in [(self.gr, self.trainf), (self.grv, self.valf), (self.grt, self.testf)]: if gr is None: res.append(None) continue ypred = [] for ogr in self.sample_pairs(gr, batch_size=len(gr), shuffle=False, once=True): ypred += list(model.predict(ogr)['score']) ypred = np.array(ypred) res.append(ev.eval_rte(ypred, gr['score'], fname)) return tuple(res)