如何在使用caret包时指定不同的类优先级?

时间:2021-02-24 20:02:41

In R, rpart function allows me to set different class priors through 'parms'. How do I set this while using the train function in caret?

在R中,rpart函数允许我通过“parms”设置不同的类先验。如何在使用插入符号中的train函数时设置它?

1 个解决方案

#1


0  

You include it inside train function.

你把它包含在训练函数里面。

As example:

为例:

library("caret")

train(Kyphosis ~ Age + Number + Start, data = kyphosis, method = "rpart",
          parms = list(prior = c(0.65, 0.35)))

#1


0  

You include it inside train function.

你把它包含在训练函数里面。

As example:

为例:

library("caret")

train(Kyphosis ~ Age + Number + Start, data = kyphosis, method = "rpart",
          parms = list(prior = c(0.65, 0.35)))