Comments (2)
Hello @MosquitoFan,
I think the issue is that the wrong kind of explainer is created (from the DALEX
package) as making the pipeline doesn't give the correct class to the pipeline object. (We would expect it to be LearnerSurv
).
However, the possible fix is simple:
- replace
explain()
function withexplain_survival()
when creating your explainer. - So the code should look like this:
explainer <- explain_survival(model = xgb_lrn, data = train, y = Surv(time[!fold == i1],event[!fold == i1]), predict_function = function(model,newdata){ predict(model, newdata, predict_type = "<Prediction>")$crank }, predict_survival_function = function(model,newdata,times){ t(predict(model, newdata, predict_type = "<Prediction>")$distr$survival(times)) }, predict_cumulative_hazard_function = function(model,newdata,times){ t(predict(model, newdata, predict_type = "<Prediction>")$distr$cumHazard(times)) } )
I've tested it on some of my data and it works. Let me know if it solved your issue :)
P.S.
If you see residuals ...
in the last line of output when creating an explainer you're creating a DALEX
not a survex
explainer.
from survex.
Hi mikolaj,
Thank you so much, it works and the plot looks beautiful!
from survex.
Related Issues (20)
- Website theme
- Update reference to SurvSHAP(t)
- SurvSHAP(t) not working when target columns named different than time and status
- SurvSHAP(t) calculation with `kernelshap` package
- SurvLIME doesn't work when all variables are categorical
- Add possibility for plotting multiple local explanations for the same model
- Refactor print code
- Changed format of the arranged multiple plots
- Integration type =
- Integration of metrics with `normalization = "survival"` doesn't work
- Rugs are plotted based on `y` for the entire dataset
- How to understand the model_parts() to get the importantce of features HOT 4
- Parallel analysis for model_parts function HOT 2
- SurvLIME sometimes doesn't print or plot for CPH model HOT 1
- Feature: add support for computing SurvSHAP using treeshap-algorithm HOT 2
- Request: Ability to use testing data for performance evaluation HOT 1
- Suggestion on progressr HOT 4
- Code snippets for survival SVM and survival GBM HOT 1
- Partial Dependence plots exclusively for a specific set of observations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survex.