api documentation
Trees
Export tree data from model. |
|
|
Generic tree structure in tabular format. |
LightGBM
|
Class to hold the LightGBM trees in tabular format. |
|
Editable LightGBM booster. |
|
Dataclass for the metadata in header section of a Booster. |
|
Data class for individual LightGBM trees. |
|
String version of a LightGBM Booster. |
Scikit-Learn
|
Scikit-Learn GradientBoosting trees in tabular format. |
Scikit-Learn HistGradientBoosting trees in tabular format. |
XGBoost
|
Class to hold the XGBoost trees in tabular format. |
|
Class that dumps an xgboost Booster then parses the dumped file. |
Dataclass for XGBoost models that have been parsed from a model dump. |
Warning
The XGBoostParser is depreceated, Booster.trees_to_dataframe can be
used instead to extract tree data from a Booster object.
Explain
|
Decompose prediction from tree based model with Saabas method[1]. |
|
Prediction decomposition results. |
|
Calculate shapley values from TabularTrees model for row of data. |
|
Shapley values results. |
Warning
The calculate_shapley_values function is very slow and is only implemeneted for
illustration purposes.
Both xgboost and lightgbm implement the must faster treeSHAP algorithm,
accessible via the Booster.predict methods when specifying pred_contribs or
pred_contrib respectively.
Validate
|
Validate that trees conform to monotonic constraints. |
|
Results of checking monotonic constraints. |