lgbm.metric: LightGBM Metric Output

Description Usage Arguments Value Examples

Description

This function allows to get the metric values from a LightGBM log.

Usage

1
lgbm.metric(model, metrics = TRUE, data.table = TRUE)

Arguments

model

Type: list, vector of characters, character. If a list, it should come from a trained model. If a vector of characters, it must be the model text. If a character, it must be the exact file path to the log file. It cannot work without training with verbose set to FALSE.

metrics

Type: boolean. Whether to return the metrics table (TRUE) or the best iteration (FALSE).

data.table

Type: boolean. Whether to return a data.table (TRUE) or a data.frame (FALSE). Defaults to TRUE. Useless when metrics is set to FALSE.

Value

A data.table (or data.frame) with 3 to N columns, with at least: c("Iteration", "Total_Time", "Round_Time").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Get the metrics of the model trained (requires verbose = FALSE during training)
lgbm.metric(workingdir = trained[["Path"]],
log_name = trained[["Log"]],
metrics = TRUE,
data.table = TRUE)

# Get the best iteration of the model trained (requires verbose = FALSE during training)
lgbm.metric(workingdir = trained[["Path"]],
log_name = trained[["Log"]],
metrics = FALSE)

## End(Not run)

Laurae2/Laurae documentation built on May 8, 2019, 7:59 p.m.