Skip to content

Commit 0c9d8bf

Browse files
committed
🖍️ improving formatting
1 parent e71dd94 commit 0c9d8bf

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

powershap/shap_wrappers/shap_explainer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
__author__ = "Jarne Verhaeghe, Jeroen Van Der Donckt"
22

3+
import gc
34
import warnings
45
from abc import ABC
56
from copy import copy
@@ -12,8 +13,6 @@
1213
from sklearn.model_selection import train_test_split
1314
from tqdm.auto import tqdm
1415

15-
import gc
16-
1716

1817
class ShapExplainer(ABC):
1918
"""Interface class for a (POWERshap explainer class."""
@@ -185,7 +184,6 @@ def explain(
185184
# on every iteration.
186185
gc.collect()
187186

188-
189187
shaps = np.array(shaps)
190188

191189
return pd.DataFrame(data=shaps, columns=X.columns.values)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ multi_line_output = 3
5353
include_trailing_comma = true
5454
force_grid_wrap = 0
5555
combine_as_imports = true
56-
color_output = true
56+
color_output = false
5757
skip = "tests/toml_test.py"

tests/test_powershap.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
__author__ = "Jeroen Van Der Donckt"
22

3+
import hashlib
4+
35
import numpy as np
46
import pandas as pd
57
from catboost import CatBoostClassifier, CatBoostRegressor
@@ -8,8 +10,6 @@
810

911
from .conftest import dummy_classification, dummy_regression
1012

11-
import hashlib
12-
1313
### DEFAULT MODEL & AUTOMATIC MODE
1414

1515

@@ -251,8 +251,7 @@ def test_powershap_cv_groupshufflesplit(dummy_classification):
251251

252252

253253
def test_no_mutate_df(dummy_classification):
254-
"""Ensure that powershap fit doesn't mutate an input pandas dataframe.
255-
"""
254+
"""Ensure that powershap fit doesn't mutate an input pandas dataframe."""
256255
X, y = dummy_classification
257256
n_informative = sum([c.startswith("informative") for c in X.columns])
258257
assert n_informative > 0, "No informative columns in the dummy data!"
@@ -277,8 +276,7 @@ def test_no_mutate_df(dummy_classification):
277276

278277

279278
def test_no_mutate_numpy(dummy_classification):
280-
"""Ensure that powershap fit doesn't mutate an input numpy array.
281-
"""
279+
"""Ensure that powershap fit doesn't mutate an input numpy array."""
282280
X, y = dummy_classification
283281

284282
X = X.to_numpy()

0 commit comments

Comments
 (0)