Closed komosinskid closed 5 years ago
library(DALEX2) library(ggplot2) library(breakDown2) head(HR) new_observation <- HR_test[1,] new_observation library(nnet) m_glm <- multinom(status ~ . , data = HR, probabilities = TRUE, model = TRUE) p_fun <- function(object, newdata){predict(object, newdata=newdata, type="prob")} bd_glm <- local_attributions(m_glm, data = HR_test, new_observation = new_observation, keep_distributions = TRUE, predict_function = p_fun) #bd_glm plot(bd_glm) plot(bd_glm, start_baseline = TRUE) plot(bd_glm, plot_distributions = TRUE)
bd_glm causes error plot bd_glm overlaps figures
plot distrobutions work well
sometimes predict returns a vector and sometimes a data frame
fixed as in https://modeloriented.github.io/iBreakDown/articles/vignette_breakDown2_classification.html
bd_glm causes error plot bd_glm overlaps figures
plot distrobutions work well