I am currently trying to add a functionality to treeshap that allows to compute SHAP values depending on the survival time.
My goal is to provide SHAP values computed with treeshap that allow to be further used with the survex R package in order to compute SurvSHAP(t) values, as the current computation using kernelshap seems to be rather slow for ranger (https://github.com/ModelOriented/survex/blob/main/R/surv_shap.R#L148).
Somehow, the difference between unified and original predictions increases with greater death_times, leading to a failing of the original comparison (expect_true(all(abs((from_unified - original) / original) < 10**(-14)))).
Does that somehow make sense? If this seems errorneous, would you have an idea, where the error might be located?
Hello @pbiecek,
I am currently trying to add a functionality to treeshap that allows to compute SHAP values depending on the survival time. My goal is to provide SHAP values computed with treeshap that allow to be further used with the
survex
R package in order to compute SurvSHAP(t) values, as the current computation usingkernelshap
seems to be rather slow forranger
(https://github.com/ModelOriented/survex/blob/main/R/surv_shap.R#L148).The current state of implementation is located here in my fork: https://github.com/kapsner/treeshap/commit/ead7d157fc901e79f330ab5e6b78e7d42d431f59
Before I open a PR here, I want to make sure that there are no major issues.
At one of the unit tests, I encountered some irregularities when comparing "unified" to "original" predictions: https://github.com/kapsner/treeshap/blob/master/tests/testthat/test_ranger_surv.R#L142
Somehow, the difference between unified and original predictions increases with greater death_times, leading to a failing of the original comparison (
expect_true(all(abs((from_unified - original) / original) < 10**(-14)))
).Does that somehow make sense? If this seems errorneous, would you have an idea, where the error might be located?
Thanks a lot in advance. Best, Lorenz