I want to create explanator with Dalex of RandomForest model, but when trying I got this error:
Error: $ operator is invalid for atomic vectors
Anyone knows how to solve this issue?
Here my code:
library(DALEX)
library(ranger)
model <- ranger(Species ~ .,data = iris,probability =T,classification = T)
explanation <- explain(model,
data=iris,
y = iris$Species,
model_info = "classification",
label="Random Forest")
Thanks!
EDIT: I have try with this code
library(DALEX)
library(ranger)
model <- ranger(Species ~ .,iris)
model_info <- list(package = "ranger", ver = "0.12.1", type = "classification")
explanation <- explain(model,
data=iris,
y = iris$Species,
label="Random Forest")
plot(model_profile(explanation))
But this do not print the influence of the variables.