tabular_trees.XGBoostParser

class tabular_trees.XGBoostParser(model, reader=None)[source]

Bases: object

Class that dumps an xgboost Booster then parses the dumped file.

__init__(model, reader=None)[source]

Initialise the XGBoostParser object.

Parameters:
  • model (xgb.core.Booster) – Model to parse trees into tabular data.

  • reader (Optional[DumpReader], default = ()) – DumpReader capable of reading dumped xgboost model. JsonDumpReader will be used if reader is not provided.

Methods

__init__(model[, reader])

Initialise the XGBoostParser object.

parse_model()

Dump model and then parse into tabular structure.

parse_model()[source]

Dump model and then parse into tabular structure.

Tree data is returned in a ParsedXGBoostTabularTrees object.

Returns:

trees – Model trees in tabular format.

Return type:

ParsedXGBoostTabularTrees