File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,6 @@ def _snd(x):
3030 return x [1 ]
3131
3232
33- def _rho (x ):
34- return np .floor (x ) + 0.5
35-
36-
3733class BallCover (Proximity ):
3834 """
3935 Cover algorithm based on `ball proximity function`, covering data with
@@ -275,7 +271,7 @@ def fit(self, X):
275271 return self
276272
277273 def search (self , x ):
278- center = self ._gamma_n_inv ( _rho ( self . _gamma_n ( x )) )
274+ center = self ._phi ( x )
279275 return self .__cover .search (center )
280276
281277 def landmarks (self , X ):
@@ -288,13 +284,16 @@ def landmarks(self, X):
288284
289285 def _get_center (self , x ):
290286 cell = self .__n_intervals * (x - self .__min ) // self .__delta
291- center = self ._gamma_n_inv ( _rho ( self . _gamma_n ( x )) )
287+ center = self ._phi ( x )
292288 return tuple (cell ), center
293289
294290 def _get_overlap_frac (self , dim , overlap_vol_frac ):
295291 beta = math .pow (1.0 - overlap_vol_frac , 1.0 / dim )
296292 return 1.0 - 1.0 / (2.0 - beta )
297293
294+ def _phi (self , x ):
295+ return self ._gamma_n_inv (0.5 + np .floor (self ._gamma_n (x )))
296+
298297 def _gamma_n (self , x ):
299298 return self .__n_intervals * (x - self .__min ) / self .__delta
300299
You can’t perform that action at this time.
0 commit comments