1

I'm working with caret and the method avNNET. I would like to try all subsets of variables while doing cross validation. So I can determine the best predictors and parameters (like a brute-force approach).

I have used stepAIC with glm, is there something similar?

jmuhlenkamp
  • 2,102
  • 1
  • 14
  • 37
iamdeit
  • 5,485
  • 4
  • 26
  • 40
  • There is an example of feature selection in http://stackoverflow.com/questions/17529537/example-for-svm-feature-selection-in-r If you change method = "svmRadial" to method = "avNNet", the script does what you need? – Gorka May 05 '17 at 19:26

1 Answers1

0

In the caret manual you will find the "pcaNNet" method, which is Neural Networks with Feature Extraction.

An example using it:

# define training control
train_control <- trainControl(method="repeatedcv", number=10, repeats = 10, classProbs = TRUE)

# train the model
model <- train(Status~., data=My_data, trControl=train_control, method="pcaNNet", metric = "Kappa")

# summarize results
print(model)

# Confusion matrix
model %>% confusionMatrix() 
Gorka
  • 3,555
  • 1
  • 31
  • 37