You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a dataset has some any missing values, global and local functions don't work because the generated prediction matrix has different dimensions. This problem occurs even when na.action = "na.impute" is used.
library(mlr3verse)
#> Warning: package 'mlr3verse' was built under R version 4.1.2#> Loading required package: mlr3
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 4.1.2#> Warning: package 'ggplot2' was built under R version 4.1.2#> Warning: package 'tibble' was built under R version 4.1.2#> Warning: package 'tidyr' was built under R version 4.1.2#> Warning: package 'readr' was built under R version 4.1.2#> Warning: package 'purrr' was built under R version 4.1.2#> Warning: package 'dplyr' was built under R version 4.1.2#> Warning: package 'stringr' was built under R version 4.1.2#> Warning: package 'forcats' was built under R version 4.1.2
library(randomForestSRC)
#> #> randomForestSRC 3.0.2 #> #> Type rfsrc.news() to see new features, changes, and bug fixes. #> #> #> Attaching package: 'randomForestSRC'#> The following object is masked from 'package:purrr':#> #> partial#> The following object is masked from 'package:mlr3verse':#> #> tune
library(survival)
library(survxai)
#> Loading required package: prodlim#> Warning: package 'prodlim' was built under R version 4.1.2#> Welcome to survxai (version: 0.2.1).#> Information about the package can be found in the GitHub repository: https://github.com/MI2DataLab/survxai#> #> Attaching package: 'survxai'#> The following object is masked from 'package:dplyr':#> #> explaintask= tsk("actg")
task2= tsk("lung")
os= rfsrc(Surv(time, status)~. , task$data(), na.action="na.impute", importance="permute")
os2= rfsrc(Surv(time, status)~. , task2$data(), na.action="na.impute", importance="permute")
rsf_explain= explain(model=os,
data=task$data()[, -c(1:2)],
y= Surv(task$data()$time, task$data()$status))
rsf_explain2= explain(model=os2,
data=task2$data()[, -c(1:2)],
y= Surv(task2$data()$time, task2$data()$status))
model_performance(rsf_explain) %>% plot()
#> No covariates specified: Kaplan-Meier for censoring times used for weighting.
model_performance(rsf_explain2) %>% plot()
#> No covariates specified: Kaplan-Meier for censoring times used for weighting.#> No covariates specified: Kaplan-Meier for censoring times used for weighting.#> Error in predictSurvProb.rfsrc(X.model, newdata, times): #> Prediction matrix has wrong dimensions:#> Requested newdata x times: 228 x 187#> Provided prediction matrix: 167 x 187
The text was updated successfully, but these errors were encountered:
aalhadab
changed the title
Global and Local Explanation Functions Do Work With Dataset With Missing Values
Global and Local Explanation Functions Do Not Work With Datasets Have Any Missing Values
Mar 29, 2022
As far as I am aware, the deprecation of the survxai package is not the official statement of the package maintainer @AleksandraDabrowska . Good manners and programming practices would require at least asking the author.
When a dataset has some any missing values, global and local functions don't work because the generated prediction matrix has different dimensions. This problem occurs even when na.action = "na.impute" is used.
Created on 2022-03-28 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: