Skip to content

Commit

Permalink
update: simplify unnecessary 'np.diag(...)' in ft_t1
Browse files Browse the repository at this point in the history
  • Loading branch information
FelSiq committed Jan 7, 2024
1 parent 1867b69 commit 0afd1fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymfe/complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2234,10 +2234,10 @@ def _recurse_radius_calc(ind_inst: int) -> float:
ref_dists = (
radiuses
if agglomeration_reference == "center"
else (radiuses - radiuses[:, np.newaxis] + np.diag(radiuses))
else (radiuses - radiuses[:, np.newaxis])
)

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

0 comments on commit 0afd1fc

Please sign in to comment.