title: Classification - Usage of factor levels
body: <p>I am currently working on a predictive model for a churn problem. <br>
  Whenever I try to run the following model, I get this error: At least one of the class levels is not a valid R variable name. This will cause errors when class probabilities are generated because the variables names will be converted to X0, X1. Please use factor levels that can be used as valid R variable names.</p>
  
  <pre><code>fivestats &lt;- function(...) c( twoClassSummary(...), defaultSummary(...))
  fitControl.default    &lt;- trainControl( 
      method  = "repeatedcv"
    , number  = 10
    , repeats = 1 
    , verboseIter = TRUE
    , summaryFunction  = fivestats
    , classProbs = TRUE
    , allowParallel = TRUE)
  set.seed(1984)
  
  rpartGrid             &lt;-  expand.grid(cp = seq(from = 0, to = 0.1, by = 0.001))
  rparttree.fit.roc &lt;- train( 
      churn ~ .
    , data      = training.dt  
    , method    = "rpart"
    , trControl = fitControl.default
    , tuneGrid  = rpartGrid
    , metric = 'ROC'
    , maximize = TRUE
  )
  </code></pre>
  
  <p>In the attached picture you see my data, I already transformed some data from chr to factor variable. </p>
  
  <p><img src="https://i.stack.imgur.com/He1Va.png" alt="DATA OVERVIEW"></p>
  
  <p>I do not get what my problem is, if I would transform the entire data into factors, then for instance the variable total_airtime_out will probably have around 9000 factors. </p>
  
  <p>Thanks for any kind of help!</p>