def on_epoch_end(self, epoch, logs={}):
        yh = self.model.predict(self.X, verbose=True).ravel()
        print yh[:30]
        fpr, tpr, _ = roc_curve(self.y, yh, sample_weight=self.weights)
        select = (tpr > 0.1) & (tpr < 0.9)
        current = auc(tpr[select], 1 / fpr[select])

        if current > self.best:
            if self.verbose > 0:
                print("Epoch %05d: %s improved from %0.5f to %0.5f, saving model to %s"
                      % (epoch, 'AUC', self.best, current, self.filepath))
            self.best = current
            self.model.save_weights(self.filepath, overwrite=True)
        else:
            if self.verbose > 0:
                print("Epoch %05d: %s did not improve" % (epoch, 'AUC'))
dataset/ETHPy150Open ml-slac/deep-jets/training/maxout-train-hypercube.py/ROCModelCheckpoint.on_epoch_end/original