Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SurvSHAP(t) values for cumulative hazard function #3

Closed
mari-sem opened this issue Oct 28, 2022 · 2 comments · Fixed by #6
Closed

SurvSHAP(t) values for cumulative hazard function #3

mari-sem opened this issue Oct 28, 2022 · 2 comments · Fixed by #6

Comments

@mari-sem
Copy link

Dear authors,

firstly, thank you very much for providing the opportunity to explain survival models with SHAP values!

I would like to calculate SHAP values based on the attribution to the cumulative hazard function. I was thinking that setting predict_cumulative_hazard_function to True for the object SurvivalModelExplainer would mean calculating SHAP for the chf, but no matter how I vary the parameters predict_cumulative_hazard_function and predict_survival_function the resulted SHAP values do not seem to change.

In the code I saw the opportunity to set the function_type to chf for the PredictSurvSHAP object, but even though SurvivalModelExplainer seems to call PredictSurvSHAP I found no way of setting function_type via SurvivalModelExplainer.

Could you please tell me how can I produce SHAP values for chf? Am I right that current explanations are based on the attribution to survival function?

Kind Regards,
Mariia

@krzyzinskim krzyzinskim linked a pull request Nov 25, 2022 that will close this issue
@krzyzinskim
Copy link
Collaborator

krzyzinskim commented Nov 25, 2022

Dear Mariia,
thank you for your interest in SurvSHAP(t) method.

You are right, by default, current explanations are based on the attribution to survival function. However, from the technical side, nothing prevents the use of the cumulative hazard function. As you've noticed, this was already available on a local level before (as we focused on local explanations in the article).

Now, I have also added this option on the global level. Just create a ModelSurvSHAP object and set the function_type to"chf", i.e., survshap_global = ModelSurvSHAP(function_type="chf").

By default, the model's method called predict_cumulative_hazard_function is used in this case, which is compatible with the models implemented in the scikit-survival package. I'm going to add support for other methods in the coming days.

Kind Regards,
Mateusz

@mari-sem
Copy link
Author

Dear Mateusz,

thank you very much for your reply and for the implemented changes!

Kind Regards,
Mariia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants