Skip to content

unbundle issue with XGBoost models #81

Description

@lanedrew

When using the unbundle function on a bundled XGBoost model, even after the 0.1.3 update, there is an error associated with the argument as_booster which has become deprecated.

Below is an example of the output received when attempting to unbundle a model after loading the bundled model object:

Load the example mark model that previously was trained on the small example data

file_path <- system.file("extdata", "example_mark_model.rds", package = "ldmppr")
mark_model <- bundle::unbundle(readRDS(file_path))
Error in xgboost::xgb.load.raw(object, as_booster = TRUE) :
unused argument (as_booster = TRUE)
Calls: ... -> unbundle -> unbundle.bundle ->
Execution halted

From what I can tell, just removing the as_booster argument should address the issue in the unbundle function for XGBoost objects.

Activity

  1. juliasilge commented on Dec 23, 2025

    @juliasilge
    Member

    I don't think you should be able to unbundle an arbitrary model in this way from data stored in a package. (Unless it happened to be stored as a bundled object to start with?)

    Can you share a more straightforward example of the kind of problem you are seeing? Something along the lines of first bundling:

    library(xgboost)
    library(bundle)
    
    mod <- xgboost(mtcars[, -1], mtcars$mpg, nrounds = 3)
    bundled <- bundle(mod)
    saveRDS(bundled, "~/Desktop/xgboost_bundle.rds")

    Created on 2025-12-23 with reprex v2.1.1

    And then unbundling:

    library(xgboost)
    library(bundle)
    out <- readRDS("~/Desktop/xgboost_bundle.rds")
    unbundle(out)
    #> ##### xgb.Booster
    #> # of features: 10 
    #> # of rounds:  3

    Created on 2025-12-23 with reprex v2.1.1

    That example was using bundle 0.1.3 and xgboost 3.1.2.1.

  2. mark-burdon commented on Mar 13, 2026

    @mark-burdon
  3. juliasilge commented on Mar 17, 2026

    @juliasilge
  4. mark-burdon commented on Mar 18, 2026

    @mark-burdon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions