tabular_trees.BoosterHeader

class tabular_trees.BoosterHeader(header, version, num_class, num_tree_per_iteration, label_index, max_feature_idx, objective, feature_names, feature_infos, tree_sizes)[source]

Bases: object

Dataclass for the metadata in header section of a Booster.

__init__(header, version, num_class, num_tree_per_iteration, label_index, max_feature_idx, objective, feature_names, feature_infos, tree_sizes)

Methods

__init__(header, version, num_class, ...)

get_booster_string_rows()

Append the booster header as a list of strings.

to_string()

Concatenate header information to a single string.

Attributes

header

version

Major version of the LightGBM package.

num_class

Number of (response) classes.

num_tree_per_iteration

label_index

max_feature_idx

Number of features.

objective

Objective for the model.

feature_names

Name of each feature.

feature_infos

Range of each feature.

tree_sizes

Number of characters for each tree.

feature_infos

Range of each feature.

feature_names

Name of each feature.

get_booster_string_rows()[source]

Append the booster header as a list of strings.

Returns:

header – Header information as a list of strings.

Return type:

list[str]

max_feature_idx

Number of features.

num_class

Number of (response) classes.

objective

Objective for the model.

to_string()[source]

Concatenate header information to a single string.

Returns:

header – Header information concatenated into one string.

Return type:

str

tree_sizes

Number of characters for each tree.

This is equal to len(BoosterTree.get_booster_sting()) + 1 for each tree in the model.

version

Major version of the LightGBM package.