Skip to content

Commit 0afd1fc

Browse files
committed
update: simplify unnecessary 'np.diag(...)' in ft_t1
1 parent 1867b69 commit 0afd1fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymfe/complexity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,10 +2234,10 @@ def _recurse_radius_calc(ind_inst: int) -> float:
22342234
ref_dists = (
22352235
radiuses
22362236
if agglomeration_reference == "center"
2237-
else (radiuses - radiuses[:, np.newaxis] + np.diag(radiuses))
2237+
else (radiuses - radiuses[:, np.newaxis])
22382238
)
22392239

2240-
within_hyperspheres = orig_dist_mat < ref_dists
2240+
within_hyperspheres = orig_dist_mat <= ref_dists
22412241
agg_priority_metric = np.sum(within_hyperspheres, axis=0) if agglomeration_metric == "mass" else radiuses
22422242
sorted_sphere_inds = np.argsort(-agg_priority_metric)
22432243
sphere_inst_count = np.ones(radiuses.size, dtype=int)

0 commit comments

Comments
 (0)