[英]tuning naive Bayes classifier with Caret in R
I train a model with following code, however, I can't find out how can I change the tunegrid because the FL and Adjust were held constantly at specific value.(my dataset is categorical) 我使用以下代码训练模型,但是,由于FL和Adjust始终保持在特定值,我无法找到如何更改微调网格的方法。(我的数据集是分类的)
Activity_nb <- train(Actx, Acty,data = Dact, method = "nb", trControl = myc1,metric = "Accuracy",importance = TRUE)
Naive Bayes
2694 samples
4 predictor
4 classes: 'CC', 'CE', 'CW', 'HA'
No pre-processing
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 2425, 2424, 2426, 2425, 2425, 2423, ...
Resampling results across tuning parameters:
usekernel Accuracy Kappa
FALSE 0.8165804 0.6702313
TRUE 0.8165804 0.6702313
Tuning parameter 'fL' was held constant at a value of 0
Tuning parameter 'adjust' was held constant at a value of 1
Accuracy was used to select the optimal model using the largest value.
The final values used for the model were fL = 0, usekernel = FALSE and adjust = 1.
grid <- data.frame(fL=c(0,0.5,1.0), usekernel = TRUE, adjust=c(0,0.5,1.0))
Activity_nb <- train(..., tuneGrid=grid, ...)
hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.