Skip to content

Commit

Permalink
invoke format
Browse files Browse the repository at this point in the history
  • Loading branch information
keurfonluu committed Dec 14, 2022
1 parent fa8822b commit 686e9ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bruces/decluster/nearest_neighbor/_nearest_neighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def decluster(
# Identify background events as those classified in class with largest mean nearest-neighbor
# Given initial means, class 0 should be background events but better make sure
sig0, sig1 = gm.means_.sum(axis=-1)
idx = np.random.rand(len(X)) * (y_prob * [1.0, 1.0]).sum(axis=1) < y_prob[:, int(sig0 < sig1)]
idx = (
np.random.rand(len(X)) * (y_prob * [1.0, 1.0]).sum(axis=1)
< y_prob[:, int(sig0 < sig1)]
)
bg = np.flatnonzero(idx)

elif method == "thinning":
Expand Down

0 comments on commit 686e9ee

Please sign in to comment.