Mercurial > repos > goeckslab > pycaret_predict
changeset 11:4eca9d109de1 draft default tip
planemo upload for repository https://github.com/goeckslab/gleam commit 55deacbbc78a00f27d789e11d563ba49dfb9cf9e
author | goeckslab |
---|---|
date | Fri, 22 Aug 2025 21:13:30 +0000 |
parents | e2a6fed32d54 |
children | |
files | feature_importance.py pycaret_macros.xml |
diffstat | 2 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/feature_importance.py Fri Aug 01 14:02:26 2025 +0000 +++ b/feature_importance.py Fri Aug 22 21:13:30 2025 +0000 @@ -136,10 +136,15 @@ predict_fn = model.predict_proba if hasattr(model, "predict_proba") else model.predict - explainer = shap.Explainer(predict_fn, bg) - self.shap_model_name = explainer.__class__.__name__ + try: + explainer = shap.Explainer(predict_fn, bg) + self.shap_model_name = explainer.__class__.__name__ - shap_values = explainer(X_data) + shap_values = explainer(X_data) + except Exception as e: + LOG.error(f"SHAP computation failed: {e}") + self.shap_model_name = None + return output_names = getattr(shap_values, "output_names", None) if output_names is None and hasattr(model, "classes_"):
--- a/pycaret_macros.xml Fri Aug 01 14:02:26 2025 +0000 +++ b/pycaret_macros.xml Fri Aug 22 21:13:30 2025 +0000 @@ -1,5 +1,5 @@ <macros> - <token name="@TABULAR_LEARNER_VERSION@">0.1.0</token> + <token name="@TABULAR_LEARNER_VERSION@">0.1.0.1</token> <token name="@PYCARET_VERSION@">3.3.2</token> <token name="@SUFFIX@">1</token> <token name="@PYCARET_PREDICT_VERSION@">@PYCARET_VERSION@+@SUFFIX@</token>