dmlc / treelite

Universal model exchange and serialization format for decision tree forests

Home Page:https://treelite.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support XGBoost gblinear Booster

JustasUrbonas opened this issue · comments

Currently, XGBoost gblinear booster is not supported. Are there plans to make gblinear booster work? I'd love to increase XGBoost's inference speed.

xgb_regressor = XGBRegressor(booster="gblinear")
xgb_model = xgb_regressor.fit(X, y)

treelite_model = treelite.Model.from_xgboost(xgb_model.get_booster())

Results in:

treelite.util.TreeliteError: [12:47:41] /Users/runner/work/treelite/treelite/python/build/temp.macosx-11.0-arm64-cpython-38/treelite/src/frontend/xgboost_json.cc:670: Provided JSON could not be parsed as XGBoost model. Parsing error at offset 155: Terminate parsing due to Handler error.
":[],"gradient_booster":{"model":{"boosted_rounds":100,"weights":[3.254305E1,2.0621338E1,8.586486E-3

Treelite's current goal is to provide an exchange / storage format for decision tree models. Since gblinear is not a decision tree model, we do not plan to support it.