Skip to content

Commit edd3290

Browse files
jarverhajarverha
authored andcommitted
-
1 parent 2d93972 commit edd3290

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

powershap/utils.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,7 @@ def powerSHAP_statistical_analysis(
6161
required_iterations.append(0)
6262
effect_size.append(0)
6363
power_list.append(0)
64-
65-
#This code is required because if statsmodels does not converge, due to numpy issues (see closed issue for inhomogeneous shape) the code does not work otherwise
66-
flattened_required_iterations = []
67-
for item in required_iterations:
68-
if isinstance(item, np.ndarray):
69-
flattened_required_iterations.extend(item.tolist())
70-
else:
71-
flattened_required_iterations.append(item)
64+
7265

7366
processed_shaps_df = pd.DataFrame(
7467
data=np.hstack(
@@ -77,7 +70,7 @@ def powerSHAP_statistical_analysis(
7770
np.reshape(np.array(p_values), (len(p_values), 1)),
7871
np.reshape(np.array(effect_size), (len(effect_size), 1)),
7972
np.reshape(np.array(power_list), (len(power_list), 1)),
80-
np.reshape(np.array(flattened_required_iterations), (len(flattened_required_iterations), 1)),
73+
np.reshape(np.array(required_iterations), (len(required_iterations), 1)),
8174
]
8275
),
8376
columns=[

0 commit comments

Comments
 (0)