Skip to content

Commit

Permalink
Fix MSA plot
Browse files Browse the repository at this point in the history
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
  • Loading branch information
Yard1 committed Mar 18, 2023
1 parent cf3d0d0 commit 8e8e7ce
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pycaret/internal/pycaret_experiment/supervised_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4313,13 +4313,17 @@ def msa(show: bool = True):
from interpret.blackbox import MorrisSensitivity

try:
msa = MorrisSensitivity(
predict_fn=model.predict_proba, data=test_X
) # classification
except AttributeError:
msa = MorrisSensitivity(
predict_fn=model.predict, data=test_X
) # regression
# interpret>=0.3.1
msa = MorrisSensitivity(model=model, data=test_X)
except TypeError:
try:
msa = MorrisSensitivity(
predict_fn=model.predict_proba, data=test_X
) # classification
except AttributeError:
msa = MorrisSensitivity(
predict_fn=model.predict, data=test_X
) # regression
msa_global = msa.explain_global()
msa_plot = msa_global.visualize()
if save:
Expand Down

0 comments on commit 8e8e7ce

Please sign in to comment.