Missings values for variable importance for neural network in Package IML in R

111 views Asked by At

I try to get variables importance from a neural network with iml package in R. The dependant variable is binary and predictors are normalised. I get a missing value for every predictor. Here's the code I'm using:

library(mlr)
library(iml)
tsk = makeClassifTask(data = fullnorm, target = "churn")
rfa <- makeLearner("classif.nnet", predict.type = "prob")# cross validation with NN
mod = train(rfa, tsk)
X =fullnorm[which(names(fullnorm) != "churn")]
Y <- as.numeric(as.character(fullnorm$churn))
predictor = iml::Predictor$new(mod, data = X, y = Y)
imp = FeatureImp$new(predictor, loss = "f1")
plot(imp)

I get no message except the fact that missing values (i.e. all predictors) are not fit.

> plot(imp)
Warning messages:
1: Removed 15 rows containing missing values (geom_point). 
2: Removed 15 rows containing missing values (geom_segment).
0

There are 0 answers