Skip to content

Commit

Permalink
BUILD make matplotlib an optional import
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopfonseca committed Dec 12, 2023
1 parent 8260c3c commit 8f0eeb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sharp/visualization/_waterfall.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import re
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sharp.utils._utils import _optional_import

# from sharp.utils import scores_to_rank

Expand All @@ -25,6 +24,9 @@ def format_value(s, format_str):


def _waterfall(shap_values, max_display=10, show=False): # noqa
matplotlib = _optional_import("matplotlib")
plt = _optional_import("matplotlib.pyplot")

# Turn off interactive plot
if show is False:
plt.ioff()
Expand Down

0 comments on commit 8f0eeb8

Please sign in to comment.