@@ -68,10 +68,9 @@ def analyze_by_size(self, separated_clusters: List[np.ndarray]) -> Tuple[np.ndar
6868 all_assigned_clean = []
6969 nb_classes = len (separated_clusters )
7070 nb_clusters = len (np .unique (separated_clusters [0 ]))
71- summary_poison_clusters : np .ndarray = np .zeros ((nb_classes , nb_clusters ))
71+ summary_poison_clusters : np .ndarray = np .zeros ((nb_classes , nb_clusters ), dtype = object )
7272
7373 for i , clusters in enumerate (separated_clusters ):
74-
7574 # assume that smallest cluster is poisonous and all others are clean
7675 sizes = np .bincount (clusters )
7776 total_dp_in_class = np .sum (sizes )
@@ -98,8 +97,8 @@ def analyze_by_size(self, separated_clusters: List[np.ndarray]) -> Tuple[np.ndar
9897
9998 report ["Class_" + str (i )] = report_class
10099
101- report ["suspicious_clusters" ] = report ["suspicious_clusters" ] + np .sum (summary_poison_clusters ). item ()
102- return np .asarray (all_assigned_clean ), summary_poison_clusters , report
100+ report ["suspicious_clusters" ] = report ["suspicious_clusters" ] + np .sum (summary_poison_clusters )
101+ return np .asarray (all_assigned_clean , dtype = object ), summary_poison_clusters , report
103102
104103 def analyze_by_distance (
105104 self ,
@@ -187,7 +186,7 @@ def analyze_by_distance(
187186 assigned_clean = self .assign_class (clusters , clean_clusters , np .array (poison_clusters ))
188187 all_assigned_clean .append (assigned_clean )
189188
190- all_assigned_clean_array = np .asarray (all_assigned_clean )
189+ all_assigned_clean_array = np .asarray (all_assigned_clean , dtype = object )
191190 return all_assigned_clean_array , summary_poison_clusters , report
192191
193192 def analyze_by_relative_size (
0 commit comments