Skip to content

Commit 0bcbe72

Browse files
authored
Update skope_rules.py
fix invalid mask indexing for OOB samples
1 parent d9a777f commit 0bcbe72

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

skrules/skope_rules.py

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

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

0 commit comments

Comments
 (0)