add cv
This commit is contained in:
parent
0ecd6c08f3
commit
831a102d48
9
R-package/inst/examples/cross_validation.R
Normal file
9
R-package/inst/examples/cross_validation.R
Normal file
@ -0,0 +1,9 @@
|
||||
require(xgboost)
|
||||
require(methods)
|
||||
# Directly read in local file
|
||||
dtrain <- xgb.DMatrix("agaricus.txt.train")
|
||||
|
||||
history <- xgb.cv(list("max_depth"=3, "eta"=1,
|
||||
"objective"="binary:logistic"),
|
||||
dtrain, nround=3, nfold = 5, "eval_metric"="error")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user