Edit on GitHub
LightGBM
DVCLive allows you to add experiment tracking capabilities to your LightGBM projects.
Usage
Include the
DVCLiveCallback
in the callbacks list passed to the lightgbm.train
call:
from dvclive.lgbm import DVCLiveCallback
...
lightgbm.train(
param, train_data, valid_sets=[validation_data], num_round=5,
callbacks=[DVCLiveCallback()])
Parameters
-
live
- (None
by default) - OptionalLive
instance. IfNone
, a new instance will be created using**kwargs
. -
**kwargs
- Any additional arguments will be used to instantiate a newLive
instance. Iflive
is used, the arguments are ignored.
Examples
- Using
live
to pass an existingLive
instance.
from dvclive import Live
from dvclive.lgbm import DVCLiveCallback
with Live("custom_dir") as live:
lightgbm.train(
param,
train_data,
valid_sets=[validation_data],
num_round=5,
callbacks=[DVCLiveCallback(live=live)])
# Log additional metrics after training
live.log_metric("summary_metric", 1.0, plot=False)
- Using
**kwargs
to customize the newLive
instance.
lightgbm.train(
param,
train_data,
valid_sets=[validation_data],
num_round=5,
callbacks=[DVCLiveCallback(dir="custom_dir")])