@@ -71,7 +71,7 @@ def __init__(
7171 self .filter = None
7272
7373 self .y = None
74- self .l = None
74+ self .low = None
7575 self .u = None
7676 self .classifier_stdpnf = None
7777 self .order = None
@@ -198,9 +198,13 @@ def __min_neighbor_and_distance(self):
198198
199199 :return: distance vector, nearest neighbor vector
200200 """
201+ if self .rho is None :
202+ raise ValueError ("Encountered rho as None." )
203+
201204 sort_rho_idx = np .argsort (- self .rho )
202205 delta , nneigh = [float (self .max_dis )] * self .n_id , [0 ] * self .n_id
203206 delta [sort_rho_idx [0 ]] = - 1.0
207+
204208 for i in range (self .n_id ):
205209 for j in range (0 , i ):
206210 old_i , old_j = sort_rho_idx [i ], sort_rho_idx [j ]
@@ -359,20 +363,20 @@ def __enane(self, fx, nan, r):
359363
360364 return es , es_pred
361365
362- def __init_values (self , l , u , y ):
366+ def __init_values (self , low , u , y ):
363367 """
364368 It takes in the lower and upper bounds of the data, and the data itself,
365369 and then calculates the distances between the data points,
366370 the maximum distance, the minimum distance, the dc value, the rho
367371 value, the delta value, the number of neighbors, and the structure
368372 of the data
369373
370- :param l : lower bound of the data
374+ :param low : lower bound of the data
371375 :param u: upper bound of the data
372376 :param y: the labels of the data
373377 """
374378 self .y = y
375- self .l = l
379+ self .low = low
376380 self .u = u
377381 self .data = np .concatenate ((l , u ), axis = 0 )
378382 self .n_id = self .data .shape [0 ]
@@ -470,7 +474,7 @@ def _fit_stdpnf(self):
470474 self .classifier_stdpnf = KNeighborsClassifier (
471475 n_neighbors = self .k , metric = self .distance_metric
472476 )
473- self .classifier_stdpnf .fit (self .l , self .y )
477+ self .classifier_stdpnf .fit (self .low , self .y )
474478 count = 1
475479
476480 while count <= max (self .order .values ()):
@@ -546,7 +550,7 @@ def _if_filter(self, complete, complete_y):
546550 :return: The result is a dataframe with the filtered data.
547551 """
548552 if isinstance (self .filter , ENN ):
549- original = pd .DataFrame (self .l )
553+ original = pd .DataFrame (self .low )
550554 original_y = pd .DataFrame (self .y )
551555 result , _ = self .filter .filter_original_complete (
552556 original , original_y , complete , complete_y
0 commit comments