in caret settings, if you want do 10*10 cross validation, you need to set repeats=10, number=10 and method=repeatedcv, (#2061)
if you set method=cv, actually just one 10-fold cross validation will be run; fixes #2055
This commit is contained in:
parent
7927031ffe
commit
5d093a7f4c
@ -24,7 +24,7 @@ df[,ID:=NULL]
|
|||||||
#-------------Basic Training using XGBoost in caret Library-----------------
|
#-------------Basic Training using XGBoost in caret Library-----------------
|
||||||
# Set up control parameters for caret::train
|
# Set up control parameters for caret::train
|
||||||
# Here we use 10-fold cross-validation, repeating twice, and using random search for tuning hyper-parameters.
|
# Here we use 10-fold cross-validation, repeating twice, and using random search for tuning hyper-parameters.
|
||||||
fitControl <- trainControl(method = "cv", number = 10, repeats = 2, search = "random")
|
fitControl <- trainControl(method = "repeatedcv", number = 10, repeats = 2, search = "random")
|
||||||
# train a xgbTree model using caret::train
|
# train a xgbTree model using caret::train
|
||||||
model <- train(factor(Improved)~., data = df, method = "xgbTree", trControl = fitControl)
|
model <- train(factor(Improved)~., data = df, method = "xgbTree", trControl = fitControl)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user