2017-02-15 3 views
0

Ich trainiere ein Modell mit folgendem Code, aber ich kann nicht herausfinden, wie kann ich das tunegrid ändern, weil die FL und Adjust konstant auf bestimmten Wert gehalten wurden. (Mein Datensatz ist kategorischTuning Naive Bayes Klassifikator mit Caret in R

)
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. 

Antwort

2
grid <- data.frame(fL=c(0,0.5,1.0), usekernel = TRUE, adjust=c(0,0.5,1.0)) 

Activity_nb <- train(..., tuneGrid=grid, ...) 

Hoffnung, das hilft.

+0

bitte erklären Sie es –

Verwandte Themen