title: R (Caret) - Error while training "mlpML" model in loop
body: <p>I'm using the Caret package from R to train Multilayer Perceptron (mlpML) models.</p>
  
  <p>What I'm trying to do is Forward feature elimination technique and see how mlpML models perform for a different number of features.</p>
  
  <p>That's why I was training mlpML models in a loop wherein every iteration, one new feature was added and fed into the model.</p>
  
  <p>Here is the error I got - </p>
  
  <pre><code>Error: Please use column names for `x`
  </code></pre>
  
  <p>Here is my code - </p>
  
  <pre><code>ig_features &lt;- c("F1", "F2", "F3", "F4", "F5")
  
  library(caret)
  
  x_features &lt;- c()
  
  for (i in ig_features) {
  
    x_features &lt;- c(x_features, i)
    y_features &lt;- c("Status")
  
    #------------------------------------------ Building Model ---------------------------------------------------
    set.seed(1234)
  
    mlp_grid = expand.grid(layer1 = 10,
                           layer2 = 10,
                           layer3 = 10)
  
    mlp_fit = caret::train(x = TRAIN[,x_features], 
                           y = TRAIN[,y_features],
                           method = "mlpML",
                           preProc =  c('center', 'scale', 'knnImpute', 'pca'),
                           trControl = trainControl(method = "cv", verboseIter = TRUE, returnData = FALSE),
                           tuneGrid = mlp_grid)
  
    #------------------------------------------ Prediction &amp; Evaluation -----------------------------------------
    predictions &lt;- predict(mlp_fit, newdata=TEST[,x_features])
  
    cat("Accuracy:",confusionMatrix(predictions, 
                                    PARKINSON_TRAIN$Status, 
                                    dnn = c("Prediction", "Actual"), 
                                    positive="1")$overall[[1]],"\n")
  }
  </code></pre>