Skip to content

Commit 34595fd

Browse files
committed
fix condition for raisin error
1 parent 97bd27d commit 34595fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/hidimstat/conditional_randomization_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,15 @@ def fit(self, X, y=None):
9595
return self
9696

9797
def _check_fit(self):
98+
fitted = True
9899
try:
99100
self.generator._check_fit()
100-
except ValueError as exc:
101+
except ValueError:
102+
fitted = False
103+
if not fitted:
101104
raise ValueError(
102105
"The CRT requires to be fitted before computing importance"
103-
) from exc
106+
)
104107

105108
def importance(self, X, y):
106109
"""

0 commit comments

Comments
 (0)