Skip to content

Convert pretrained models to UBJSON for XGBoost v3 support #265

Description

@RalfG

TODO: convert pretrained models to UBJSON for XGBoost v3 support

XGBoost 3.1+ dropped loading support for the legacy binary format (dmlc/xgboost#11307). All pretrained models in constants.py are still in that legacy binary format (pre-1.0.0), so they fail to load on xgboost>=3.1:

xgboost._c_api.XGBoostError: [...] c_api.cc:1523: Check failed: str[0] == '{'

Verified: 2.1.4 and 3.0.5 load fine (with a deprecation warning), 3.3.0 fails. This is why pyproject.toml currently pins xgboost>=1.3,<3.

Tasks:

  • Re-save all model files as .ubj (booster.save_model("model.ubj"))
  • Re-host converted files (genesis.ugent.be + Zenodo)
  • Update filenames/SHA1 hashes in ms2pip/constants.py
  • Bump pyproject.toml pin to allow xgboost 3.x
  • Verify predictions unchanged pre/post conversion

Compat note: UBJSON support was only added in xgboost 1.6 — verified .ubj/.json files saved by 2.1.4 fail to load on 1.3.3/1.4.2/1.5.2, work from 1.6.2 up. So this conversion also requires raising the lower pin bound from >=1.3 to >=1.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions