[R] error in train function

David Winsemius dw|n@em|u@ @end|ng |rom comc@@t@net
Sun Nov 3 17:03:43 CET 2019


On 11/1/19 11:27 AM, javed khan wrote:
> 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


No library calls, so we will need to guess what packages are being assumed.

>
>
> 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",


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?


-- 

David.

>                   trControl = fitControl,
>                   verbose = FALSE, metric = "ROC")
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list