交叉验证中的R Caret离散化

我正在使用R caret软件包,并且想对交叉验证中的所有预测变量应用离散化功能。

例如使用以下代码:

# load the library
library(caret)
# load the iris dataset
data(iris)
# define training control
train_control <- trainControl(method="cv",number=10)
# fix the parameters of the algorithm
grid <- expand.grid(.fL=c(0),.usekernel=c(FALSE))
# train the model
model <- train(Species~.,data=iris,trControl=train_control,method="nb",tuneGrid=grid)
# summarize results
print(model)

我想仅使用训练折叠来应用规则discretizeDF.supervisedhttps://www.rdocumentation.org/packages/arulesCBA/versions/1.1.4/topics/discretizeDF.supervised)来学习正确的分组,然后将其应用于测试折叠。只要有监督,我不介意使用任何其他库/函数进行离散化。

AFAIK这是离散化的正确方法,因此它必须是离散化的一种方法。我一直在阅读有关“食谱”的信息,但无法使其发挥作用。

nongdada123456 回答:交叉验证中的R Caret离散化

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3170092.html

大家都在问