@@ -59,7 +59,7 @@ def _get_centroids(self):
5959 endpoint = False , retstep = False , dtype = None )[1 :]
6060 coordinates = np .tile (axis_point , (self .dim_per_byte , 1 ))
6161 elif self .partition_method == 'random' :
62- coordinates = np .random .randint (self .lower_bound , self .upper_bound ,
62+ coordinates = np .random .uniform (self .lower_bound , self .upper_bound ,
6363 size = [self .dim_per_byte , num_sample_per_dim ])
6464 else :
6565 raise NotImplementedError
@@ -95,12 +95,12 @@ def _get_max_min_value(vecs):
9595
9696 def _check_bound (self , max_value , min_value ):
9797 if self .upper_bound < max_value :
98- self . logger . warning ("upper bound (=%.3f) is smaller than max value of input data (=%.3f), you should choose"
98+ raise Warning ("upper bound (=%.3f) is smaller than max value of input data (=%.3f), you should choose"
9999 "a bigger value for upper bound" % (self .upper_bound , max_value ))
100100 if self .lower_bound > min_value :
101- self . logger . warning ("lower bound (=%.3f) is bigger than min value of input data (=%.3f), you should choose"
101+ raise Warning ("lower bound (=%.3f) is bigger than min value of input data (=%.3f), you should choose"
102102 "a smaller value for lower bound" % (self .lower_bound , min_value ))
103103 if (self .upper_bound - self .lower_bound ) >= 10 * (max_value - min_value ):
104- self . logger . warning ("(upper bound - lower_bound) (=%.3f) is 10 times larger than (max value - min value) "
104+ raise Warning ("(upper bound - lower_bound) (=%.3f) is 10 times larger than (max value - min value) "
105105 "(=%.3f) of data, maybe you should choose a suitable bound" %
106106 ((self .upper_bound - self .lower_bound ), (max_value - min_value )))
0 commit comments