title: Error with tuning custom SVM model in caret
body: <p>I'm having trouble with my custom training model in the caret package. I need to do a SVM regression and I want to find all the parameters of the SVM model - cost, sigma and epsilon. The built-in version has only cost and sigma. I have already found quite a helpful tip <a href="https://stackoverflow.com/questions/27828120/error-with-custom-svm-model-for-tuning-in-caret">here</a> and <a href="https://stats.stackexchange.com/questions/113756/import-kernlad-model-to-caret">here</a> but my model still does not work.</p>
  <blockquote>
  <p>Error in models$grid(x = x, y = y, len = tuneLength, search = trControl$search) :
  unused argument (search = trControl$search)</p>
  </blockquote>
  <p>This error is the one I am getting and my code is here.</p>
  <pre><code>SVMrbf &lt;- list(type = &quot;Regression&quot;, library = &quot;kernlab&quot;, loop = NULL)
  prmrbf &lt;- data.frame(parameters = data.frame(parameter = c('sigma', 'C', 'epsilon'),
                                           class = c(&quot;numeric&quot;, &quot;numeric&quot;, &quot;numeric&quot;),
                                           label = c('Sigma', &quot;Cost&quot;, &quot;epsilon&quot;)))
  SVMrbf$parameters &lt;- prmrbf
  svmGridrbf &lt;- function(x, y, len = NULL) {
                    library(kernlab)
                    sigmas &lt;- sigest(as.matrix(x), na.action = na.omit, scaled = TRUE, frac = 1)
                    expand.grid(sigma = mean(sigmas[-2]), epsilon = 10^(-5:0),
            C = 2 ^(-5:len)) # len = tuneLength in train
  }
  SVMrbf$grid &lt;- svmGridrbf
  svmFitrbf &lt;- function(x, y, wts, param, lev, last, weights, classProbs, ...) {
                     ksvm(x = as.matrix(x), y = y,
                           type = &quot;eps-svr&quot;,
                           kernel = &quot;rbfdot&quot;,
                           sigma = param$sigma,
                           C = param$C, epsilon = param$epsilon,
                           prob.model = classProbs,
                           ...)
  }
  SVMrbf$fit &lt;- svmFitrbf
  svmPredrbf &lt;- function(modelFit, newdata, preProc = NULL, submodels = NULL)
    predict(modelFit, newdata)
  SVMrbf$predict &lt;- svmPredrbf
  svmProb &lt;- function(modelFit, newdata, preProc = NULL, submodels = NULL)
    predict(modelFit, newdata, type=&quot;probabilities&quot;)
  SVMrbf$prob &lt;- svmProb
  svmSortrbf &lt;- function(x) x[order(x$C), ]
  SVMrbf$sort &lt;- svmSortrbf
  
  
  svmRbfFit &lt;- train(x = train.predictors1, y = train.response1, method =       SVMrbf,
                   tuneLength = 10)
  svmRbfFit
  </code></pre>
  <p>I could not find anyone, who had the same error and have no clue what is actually wrong. This code is pretty much just something I found online and slightly altered.</p>
  <p>BTW this is my first post, so hopefully it's understandable, if not I can add additional info.</p>