Skip to content

error in train function

2 messages · javed khan, David Winsemius

#
Hi

I receive the following error, where is the problem?

Error in train(Effort ~ ., data = d, method = "lpSVM", trControl =
fitControl,  :
  unused arguments (data = d, method = "lpSVM", trControl = fitControl,
verbose = FALSE, metric = "ROC")

The code is here


fitControl <- trainControl(method = "repeatedcv",
                           number = 10,
                           repeats = 10,
                              classProbs = TRUE,
                        summaryFunction = twoClassSummary)

myGrid <-  expand.grid(interaction.depth = c(1, 5, 9),
                        n.trees = (1:30)*50,
                        shrinkage = 0.1,
                        n.minobsinnode = 20)
Fit3 <- train(Effort ~ ., data = d,
                 method = "lpSVM",
                 trControl = fitControl,
                 verbose = FALSE, metric = "ROC")
1 day later
#
On 11/1/19 11:27 AM, javed khan wrote:
No library calls, so we will need to guess what packages are being assumed.
This appears to be calling the caret::train.recipe function. I cannot 
find a "lpSVM" method. Is it possible that this is simply a misspelling? 
Or have you failed to create a method with that name?


In the tutorial: 
https://topepo.github.io/caret/using-your-own-model-in-train.html the 
package author creates a list with that name in the section entitled 
"Model Components".

|lpSVM <-list(type = "Classification", library = "kernlab", loop = NULL) |

My further guess: you trying to run code fragments from some source 
without fully executing parts of a multi-step process?