title: Error in train.default(x, y, weights = w, ...) : final tuning parameters could not be determined
body: <p>I am very new at machine learning and am attempting the <a href="https://www.kaggle.com/c/forest-cover-type-prediction" rel="nofollow">forest cover prediction competition on Kaggle</a>, but I am getting hung up pretty early on. I get the following error when I run the code below.</p>
  
  <pre>Error in train.default(x, y, weights = w, ...) : 
  final tuning parameters could not be determined
  In addition: There were 50 or more warnings (use warnings() to see the first 50)
  </pre>
  
  <pre><code># Load the libraries
  library(ggplot2); library(caret); library(AppliedPredictiveModeling)
  library(pROC)
  library(Amelia)
  
  set.seed(1234)
  
  # Load the forest cover dataset from the csv file
  rawdata &lt;- read.csv("train.csv",stringsAsFactors = F)
  #this data won't be used in model evaluation. It will only be used for the submission.
  test &lt;- read.csv("test.csv",stringsAsFactors = F)
  
  ########################
  ### DATA PREPARATION ###
  ########################
  
  #create a training and test set for building and evaluating the model
  samples &lt;- createDataPartition(rawdata$Cover_Type, p = 0.5,list = FALSE)
  data.train &lt;- rawdata[samples, ]
  data.test &lt;- rawdata[-samples, ]
  
  model1 &lt;- train(as.factor(Cover_Type) ~ Elevation + Aspect + Slope + Horizontal_Distance_To_Hydrology, 
                  data = data.train, 
                  method = "rf", prox = "TRUE")
  </code></pre>