jphall663 / awesome-machine-learning-interpretability

A curated list of awesome responsible machine learning resources.
Creative Commons Zero v1.0 Universal
3.57k stars 579 forks source link

errors in the tutorial (Interpreting Machine Learning Models with the iml Package) #57

Closed tomaszek0 closed 11 months ago

tomaszek0 commented 2 years ago

Re section: Comprehensive Software Examples and Tutorials (Interpreting Machine Learning Models with the iml Package) I am getting the following error when trying to execute the following code in section entitled "Replication requirements" (https://uc-r.github.io/iml-pkg):

classification data

df <- rsample::attrition %>% mutate_if(is.ordered, factor, ordered = FALSE) %>% mutate(Attrition = recode(Attrition, "Yes" = "1", "No" = "0") %>% factor(levels = c("1", "0")))

Error: 'attrition' is not an exported object from 'namespace:rsample'

The problem was solved using the following code: (...) h2o.init()

data

library(modeldata) data("attrition", package = "modeldata")

classification data

df <- attrition %>% mutate_if(is.ordered, factor, ordered = FALSE) %>% mutate(Attrition = recode(Attrition, "Yes" = "1", "No" = "0") %>% factor(levels = c("1", "0")))

Unfortunately, I got another error after trying to execute the following code (section entitled "Global interpretation/Feature importance" (https://uc-r.github.io/iml-pkg):

compute feature importance with specified loss metric

imp.glm <- FeatureImp$new(predictor.glm, loss = "mse") imp.rf <- FeatureImp$new(predictor.rf, loss = "mse") imp.gbm <- FeatureImp$new(predictor.gbm, loss = "mse")

Error in [.data.frame(prediction, , self$class, drop = FALSE) : undefined columns selected Error in [.data.frame(prediction, , self$class, drop = FALSE) : undefined columns selected Error in [.data.frame(prediction, , self$class, drop = FALSE) : undefined columns selected

I use R 4.2.0/ Win10

jphall663 commented 11 months ago

Sorry, please report these to the iml maintainers.