Skip to content

Commit 26afac3

Browse files
authored
Update skope_rules.py (fix invalid mask indexing for OOB samples)
1 parent 0bcbe72 commit 26afac3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

skrules/skope_rules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ def fit(self, X, y, sample_weight=None):
334334
self.estimators_features_):
335335

336336
# Create mask for OOB samples
337-
# mask = ~samples # samples is numpy array. when you put ~. it returns array([-(value_1 + 1), ..., -(value_n + 1)])
338337
mask = list(set(np.arange(len(samples))).difference(samples)
339-
338+
# samples is numpy array. when you put ~. it returns array([-(value_1 + 1), ..., -(value_n + 1)])
339+
340340
if sum(mask) == 0:
341341
warn("OOB evaluation not possible: doing it in-bag."
342342
" Performance evaluation is likely to be wrong"

0 commit comments

Comments
 (0)