Commit 1d83e7b9 authored by Martino Bertoni's avatar Martino Bertoni 🌋
Browse files

added check for reaching sufficient sampling before iterating all features

parent bfc43ddd
Pipeline #2410 failed with stages
in 1 minute and 51 seconds
......@@ -144,9 +144,11 @@ class BaseTransform(object):
else:
dkey = "V"
for j in tqdm(range(0, self.sign_ref.shape[1])):
if len(idxs) >= self.max_keys:
break
v = hf[dkey][:, j]
zero_feat = np.argwhere(v != 0).ravel()
candidates = list(set(zero_feat) - idxs)
non_zero_feat = np.argwhere(v != 0).ravel()
candidates = list(set(non_zero_feat) - idxs)
if len(candidates) == 0:
raise Exception(
'No feature specific candidates for subsampling. '
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment