Description Usage Arguments Value Examples
View source: R/model_lightgbm.R
extract cv prediction from lgb.cv object
1 | lgb.extract_cv_score(cv, score.fun = Metrics::auc)
|
cv |
|
score.fun |
function for scoring, score.fun(label, preds) |
list of (cv.score, cv.preds)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(lightgbm)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
params <- list(objective = "regression", metric = "l2")
model <- lgb.cv(
params = params
, data = dtrain
, nrounds = 10L
, nfold = 3L
, min_data = 1L
, learning_rate = 1.0
, early_stopping_rounds = 5L
)
res <- lgb.extract_cv_score(model, score.fun = Metrics::rmse)
res$cv.score
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.