How do I set a model sub-parameter named "method" from caret's train() function

592 views Asked by At

I am trying to build an ordinal logistic regression model from caret's train() function using the polr package. The polr model has a parameter named "method" that clashes with train()'s parameter "method". I want to set to the polr model parameter to "logistic".

How do I do this?

Thanks!

1

There are 1 answers

0
phiver On

When using polr you need to specify the method in the tunegrid option of train.

In the formula notation it should look like this:

train(y ~ x1 + x2, 
      data = my_data, 
      method = "polr", 
      trControl = my_control, 
      tunegrid = expand.grid(method = "logistic"))