File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 11__author__ = "Jarne Verhaeghe, Jeroen Van Der Donckt"
22
3+ import gc
34import warnings
45from abc import ABC
56from copy import copy
1213from sklearn .model_selection import train_test_split
1314from tqdm .auto import tqdm
1415
15- import gc
16-
1716
1817class 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 )
Original file line number Diff line number Diff line change @@ -53,5 +53,5 @@ multi_line_output = 3
5353include_trailing_comma = true
5454force_grid_wrap = 0
5555combine_as_imports = true
56- color_output = true
56+ color_output = false
5757skip = " tests/toml_test.py"
Original file line number Diff line number Diff line change 11__author__ = "Jeroen Van Der Donckt"
22
3+ import hashlib
4+
35import numpy as np
46import pandas as pd
57from catboost import CatBoostClassifier , CatBoostRegressor
810
911from .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
253253def 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
279278def 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 ()
You can’t perform that action at this time.
0 commit comments