External Libraries Based on scikit-learn#
yobx.sklearn.to_onnx() converts fitted estimators to ONNX
from xgboost, lightgbm, category_encoders,
and imbalanced-learn
using the same registry-based architecture as the other
yobx.sklearn converters.
Package |
Module |
|---|---|
|
|
|
|
|
|
|
Comparison: XGBoost vs LightGBM#
Both XGBoost and LightGBM are gradient-boosted tree
libraries — their fitted models consist of an ensemble of binary decision
trees. The converters map these trees to ONNX TreeEnsemble* operators
and share the same high-level structure, differing only in how split
conditions are expressed and how the raw margin is post-processed.
The table below summarises the key differences between the converters
for xgboost and lightgbm.
Property |
XGBoost |
LightGBM |
|---|---|---|
Tree dump method |
|
|
Split direction (numerical) |
|
|
Categorical splits |
Not supported by converter |
Expanded to BRANCH_EQ chains |
Base-score bias |
Added from |
None (baked into leaf values) |
Regression transform |
Identity / Sigmoid / Exp |
Identity / Exp |
Multi-class targets per round |
|
|
Binary classifier raw outputs |
1 tree per round (sigmoid) |
1 tree per round (sigmoid) |
imbalanced-learn#
imbalanced-learn extends scikit-learn with resampling
techniques for imbalanced datasets. Resampling only happens at training
time, so ONNX inference pipelines skip any step that exposes
fit_resample and only convert the remaining transformers and the
final estimator.
See yobx.sklearn.imblearn for the full API reference.