def choose_ltv(self, label, size):
        """Returns (loss, tid, val) of best/runner-up trial
        """
        tids = self.node_tids[label]
        vals = self.node_vals[label]
        losses = [self.tid_losses_dct[tid] for tid in tids]

        if size == 1:
            # -- try to return the value corresponding to one of the
            #    trials that was previously chosen (non-independence
            #    of hyperparameter values)
            # This doesn't really make sense if we're sampling a lot of
            # points at a time.
            tid_set = set(tids)
            for tid in self.best_tids:
                if tid in tid_set:
                    idx = tids.index(tid)
                    rval = losses[idx], tid, vals[idx]
                    return rval

        # -- choose a new good seed point
        good_idx = 1 - self.rng.geometric(1.0 / self.avg_best_idx, size=size)
        good_idx = np.clip(good_idx, 0, len(tids) - 1).astype('int32')

        picks = np.argsort(losses)[good_idx]
        picks_loss = np.asarray(losses)[picks]
        picks_tids = np.asarray(tids)[picks]
        picks_vals = np.asarray(vals)[picks]

        #ltvs = np.asarray(sorted(zip(losses, tids, vals)))
        #best_loss, best_tid, best_val = ltvs[best_idx]
        if size == 1:
            self.best_tids.append(int(picks_tids))
        return picks_loss, picks_tids, picks_vals
dataset/ETHPy150Open hyperopt/hyperopt/hyperopt/anneal.py/AnnealingAlgo.choose_ltv/swapped operands of `-`