Example #1
0
 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)
Example #2
0
 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])
Example #3
0
 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)
Example #4
0
    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)