Skip to content

Commit 9a3aceb

Browse files
committed
Fixed verbose error in benchmark
1 parent 80e8ca7 commit 9a3aceb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

decoupler/benchmark.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ def _benchmark(mat, obs, net, perturb, sign, metrics=['auroc', 'auprc'], groupby
126126

127127
# Run prediction
128128
if verbose:
129-
n_src = obs.loc[:, 'perturb'].unique().size
129+
srcs = []
130+
for p in obs.loc[:, 'perturb']:
131+
srcs.extend(p)
132+
n_src = np.unique(srcs).size
130133
print("Running {0} experiments for {1} unique sources.".format(mat.shape[0], n_src))
131134
print('Running methods...')
132135
res = decouple([mat, obs.index, var.index], net, verbose=verbose, **decouple_kws)

0 commit comments

Comments
 (0)