Skip to content

Commit f17eca3

Browse files
committed
switch to non-interactive outputs
1 parent 40606de commit f17eca3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
pip install --upgrade --force-reinstall --no-cache-dir --editable=".[test]"
3737
- name: Test with pytest
3838
run: |
39-
pytest -sv pydra_ml/tests/test_classifier.py
39+
pytest pydra_ml/tests/test_classifier.py

pydra_ml/report.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
import pickle
44
import warnings
55

6+
import matplotlib
67
import matplotlib.pyplot as plt
78
import numpy as np
89
import pandas as pd
910
import seaborn as sns
1011
from sklearn.metrics import accuracy_score, explained_variance_score
1112

13+
matplotlib.use("Agg")
14+
1215

1316
def save_obj(obj, path):
1417
with open(path, "wb") as f:

pydra_ml/tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ def get_shap(X, permute, model, gen_shap=False, nsamples="auto", l1_reg="aic"):
254254
import shap
255255

256256
explainer = shap.KernelExplainer(pipe.predict, shap.kmeans(X[train_index], 5))
257-
shaps = explainer.shap_values(X[test_index], nsamples=nsamples, l1_reg=l1_reg)
257+
shaps = explainer.shap_values(
258+
X[test_index], nsamples=nsamples, l1_reg=l1_reg, silent=True
259+
)
258260
return shaps
259261

260262

0 commit comments

Comments
 (0)