I am running a neural net machine learning model in R using Caret's "nnet". I ran the train code with "importance= TRUE".
I need to show a list of the importances of the features that were included in the model. Not sure how to proceed. Any help is appreciated!
See code below. My outcome is in column 1 and the variables in columns 2 through 45.
str(data)
levels(data$outcome) <- c("no", "yes")
caret.control <- trainControl(method="repeatedcv", number=10, repeats=3)
model <- train(y=data[,1], x=data[,c(2:45)], method="nnet", trControl=caret.control, importance=TRUE)
I am looking at
varImp(model)
but this gives an error message.
With this error message, I am researching it further:
names(model)
names(model$modelInfo)
names(model$modelInfo$varImp)
The result from this is "NULL".
Anyone know how to fix this or has seen a similar error? Not sure how to see the list of features with "nnet" Caret package model.