title: I have done TF-IDF and want to implement models in caret package [R]
body: <p>I have implemented the TF-IDF algorithm that is explained in this link: <a href="https://cran.r-project.org/web/packages/text2vec/vignettes/text-vectorization.html#tf-idf" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/text2vec/vignettes/text-vectorization.html#tf-idf</a>  </p>
  
  <p>So, the classifier is implemented like this:</p>
  
  <pre><code>glmnet_classifier = cv.glmnet(x = dtm_train_tfidf, y = train[['sentiment']], 
                                family = 'binomial', 
                                alpha = 1,
                                type.measure = "auc",
                                nfolds = NFOLDS,
                                thresh = 1e-3,
                                maxit = 1e3)
  </code></pre>
  
  <p>the types of x and y are:</p>
  
  <pre><code>&gt; typeof(dtm_train_tfidf)
  [1] "S4"
  &gt; typeof(train$setiment)
  [1] "integer"
  </code></pre>
  
  <p>How can I use a different classifer, for example in "Caret" package you would write:</p>
  
  <pre><code>model_svm&lt;-train(x = dtm_train_tfidf, y = train[['sentiment']],method='svmRadial')
  </code></pre>
  
  <p>The problem is that this does not work.
  Are there any way to implement different classifiers rather than cv.glmnet for example in caret package? Is there any connection between this inputs x,y and the caret classifiers? If not, are there any packages like cv.glmnet that can handle this type of inputs?</p>