Python API

数据结构 API

Dataset(data[, label, reference, weight, ...])

LightGBM 中的 Dataset。

Booster([params, train_set, model_file, ...])

LightGBM 中的 Booster。

CVBooster([model_file])

LightGBM 中的 CVBooster。

Sequence()

通用数据访问接口。

训练 API

train(params, train_set[, num_boost_round, ...])

使用给定参数执行训练。

cv(params, train_set[, num_boost_round, ...])

使用给定参数执行交叉验证。

Scikit-learn API

LGBMModel(*[, boosting_type, num_leaves, ...])

LightGBM 的 scikit-learn API 实现。

LGBMClassifier(*[, boosting_type, ...])

LightGBM 分类器。

LGBMRegressor(*[, boosting_type, ...])

LightGBM 回归器。

LGBMRanker(*[, boosting_type, num_leaves, ...])

LightGBM 排序器。

Dask API

版本 3.2.0 新增。

DaskLGBMClassifier(*[, boosting_type, ...])

lightgbm.LGBMClassifier 的分布式版本。

DaskLGBMRegressor(*[, boosting_type, ...])

lightgbm.LGBMRegressor 的分布式版本。

DaskLGBMRanker(*[, boosting_type, ...])

lightgbm.LGBMRanker 的分布式版本。

回调函数

early_stopping(stopping_rounds[, ...])

创建激活提前停止的回调函数。

log_evaluation([period, show_stdv])

创建记录评估结果的回调函数。

record_evaluation(eval_result)

创建将评估历史记录到 eval_result 中的回调函数。

reset_parameter(**kwargs)

创建在第一次迭代后重置参数的回调函数。

绘图

plot_importance(booster[, ax, height, xlim, ...])

绘制模型的特征重要性。

plot_split_value_histogram(booster, feature)

绘制模型指定特征的分割值直方图。

plot_metric(booster[, metric, ...])

绘制训练过程中的一个指标。

plot_tree(booster[, ax, tree_index, ...])

绘制指定的树。

create_tree_digraph(booster[, tree_index, ...])

创建指定树的有向图表示。

工具函数

register_logger(logger[, info_method_name, ...])

注册自定义日志记录器。