# NOT RUN {
library("DALEXtra")
if(DALEXtra:::is_conda()) {
# Explainer build (Keep in mind that 9th column is target)
test_data <-
read.csv(
"https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv",
sep = ",")
# Keep in mind that when pickle is being built and loaded,
# not only Python version but libraries versions has to match aswell
explainer <- explain_keras(system.file("extdata", "keras.pkl", package = "DALEXtra"),
yml = system.file("extdata", "testing_environment.yml", package = "DALEXtra"),
data = test_data[,1:8], y = test_data[,9])
plot(model_performance(explainer))
# Predictions with newdata
predict(explainer, test_data[1:10,1:8])
} else {
print('Conda is required.')
}
# }
Run the code above in your browser using DataLab