def __init__(self, model, loss, size, p, seed=None): self.model = model self.loss = loss self.p = p self.size = size self.buffer = utils.SortedWindow(self.size) self.seed = seed self._rng = random.Random(seed)
def __init__(self, q, window_size): self.window = utils.SortedWindow(size=window_size) self.q = q idx = self.q * (self.window.size - 1) self._lower = int(math.floor(idx)) self._higher = self._lower + 1 if self._higher > self.window.size - 1: self._higher = self.window.size - 1 self._frac = idx - self._lower
def __init__(self, model, loss, size, p, seed=None): self.model = model self.loss = loss self.pred_func = model.predict_one if isinstance(model, base.Classifier): self.pred_func = model.predict_proba_one if not model._multiclass: self.pred_func = lambda x: model.predict_proba_one(x)[True] self.p = p self.size = size self.buffer = utils.SortedWindow(self.size) self.seed = seed self._rng = random.Random(seed)
def __init__(self, window_size: int): self.window = utils.SortedWindow(size=window_size)