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

make pdp and cp work with NA in data #120

Closed
hbaniecki opened this issue Jul 11, 2020 · 3 comments
Closed

make pdp and cp work with NA in data #120

hbaniecki opened this issue Jul 11, 2020 · 3 comments
Assignees
Labels

Comments

@hbaniecki
Copy link
Member

@hbaniecki hbaniecki commented Jul 11, 2020

@pbiecek pbiecek self-assigned this Jul 22, 2020
pbiecek added a commit that referenced this issue Jul 28, 2020
@pbiecek
Copy link
Member

@pbiecek pbiecek commented Jul 28, 2020

I've could not find a reproducible example,
@hbaniecki would you check if this is solved?

I've checked this with

library("DALEX")
library("ingredients")
library("randomForest")

model_titanic_glm <- randomForest(survived ~ gender + age + fare,
                        data = na.omit(titanic_imputed))
titanic_imputed[2:1000,2] = NA
explain_titanic_glm <- explain(model_titanic_glm,
                              data = titanic_imputed[,-8],
                              y = titanic_imputed[,8],
                              verbose = FALSE)
pdp_glm <- partial_dependence(explain_titanic_glm,
                             N = 25, variables = c("age", "fare","sibsp"),
                             variable_splits = list(age = seq(0,100,0.1), fare = c(0:100), sibsp=0:10))
 plot(pdp_glm)
@hbaniecki
Copy link
Member Author

@hbaniecki hbaniecki commented Jul 28, 2020

I guess that after the fix it works

library("DALEX")
library("ingredients")
library("randomForest")

model_titanic_glm <- randomForest(survived ~ gender + age + fare,
                                  data = na.omit(titanic_imputed))
titanic_imputed[2:1000,2] = NA
explain_titanic_glm <- explain(model_titanic_glm,
                               data = titanic_imputed[,-8],
                               y = titanic_imputed[,8],
                               verbose = FALSE)
pdp_glm <- partial_dependence(explain_titanic_glm,
                              N = 25, variables = c("age", "fare","sibsp"))
#, variable_splits = list(age = seq(0,100,0.1), fare = c(0:100), sibsp=0:10))
plot(pdp_glm)
@pbiecek
Copy link
Member

@pbiecek pbiecek commented Jul 28, 2020

thanks

@pbiecek pbiecek closed this Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.