def shift(self, new_point): for i in range(self.iterations): curr_slice = subspace_slice( self.sorted_index.sorted, self.subspace, self.ref_dim, self.alpha ) self.res[i] = kstest(curr_slice, self.sorted_index.sorted[:, self.ref_dim]) return np.mean(self.res)
def init_result(self): self.res = np.zeros((self.iterations, 1)) for i in range(self.iterations): curr_slice = subspace_slice( self.sorted_index.sorted, self.subspace, self.ref_dim, self.alpha ) self.res[i] = kstest(curr_slice, self.sorted_index.sorted[:, self.ref_dim])
def shift(self, new_point): for i in range(self.k): curr_slice = subspace_slice( self.sorted_index.sorted, self.subspace, self.ref_dim, self.alpha ) self.res.append( kstest(curr_slice, self.sorted_index.sorted[:, self.ref_dim]) ) return np.mean(self.res)
def shift(self, new_point): to_replace = np.random.randint(0, self.iterations, self.draws) for i in to_replace: curr_slice = subspace_slice( self.sorted_index.sorted, self.subspace, self.ref_dim, self.alpha ) self.res[i] = kstest(curr_slice, self.sorted_index.sorted[:, self.ref_dim]) return np.mean(self.res)