r - run caret method without parameters -


i'm trying run caret method not requires parameters, such lda, example below uses "lvq" needs 2 parameters (size , k)

set.seed(7) # load library library(caret) # load dataset data(iris) # prepare training scheme control <- traincontrol(method="repeatedcv", number=10, repeats=3) # design parameter tuning grid grid <- expand.grid(size=c(5,10,20,50), k=c(1,2,3,4,5)) # train model model <- train(species~., data=iris, method="lvq", trcontrol=control, tunegrid=grid) # summarize model print(model) plot(model) 

i tried work out assigning tunegrid=null

set.seed(7) # load library library(caret) # load dataset data(iris) # prepare training scheme control <- traincontrol(method="repeatedcv", number=10, repeats=3) # design parameter tuning grid grid <- expand.grid(size=c(5,10,20,50), k=c(1,2,3,4,5)) # train model model <- train(species~., data=iris, method="lda", trcontrol=control, tunegrid=null) # summarize model print(model) plot(model) 

but error

there no tuning parameters model 

i'll answer own question, think deleting tunegrid=null works fine

set.seed(7) # load library library(caret) # load dataset data(iris) # prepare training scheme control <- traincontrol(method="repeatedcv", number=10, repeats=3) # design parameter tuning grid grid <- expand.grid(size=c(5,10,20,50), k=c(1,2,3,4,5)) # train model model <- train(species~., data=iris, method="lda", trcontrol=control) # summarize model print(model) 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -