Skip to content

Model creation fails with updated XGBoost (β‰₯ v2.1)Β #1227

Open
@therealjpetereit

Description

@therealjpetereit

Hi and a merry 2025 πŸŽ‰πŸ™Œ,

I just updated my XGBoost to 2.1.3 and started having problems building models with that.

I assume they did many changes when they updated from 2.0.3 to 2.1+ , but I tracked down what broke the code for me.

For me in particular the xgb.DMatrix function fails when I use the current Parsnip version (1.2.1) with Tidymodels (v 1.2.0)

the Reason is the update function in XGBoost:

Old

xgb.DMatrix <- function(data, info = list(), missing = NA, silent = FALSE, nthread = NULL, ...)  

New

xgb.DMatrix <- function(
  data,
  label = NULL,
  weight = NULL,
  base_margin = NULL,
  missing = NA,
  silent = FALSE,
  feature_names = colnames(data),
  feature_types = NULL,
  nthread = NULL,
  group = NULL,
  qid = NULL,
  label_lower_bound = NULL,
  label_upper_bound = NULL,
  feature_weights = NULL,
  data_split_mode = "row"
)

I am not sure what exactly was in the old info=list() but probably all these arguments which are now directly passed to the function.
This could be all part of their general R interface overhaul, but I thought I just let you know after I spent some time tracking this down.

For now I downgrade to 2.0.3 and wait until you had the time to update the functionality to match the newer XGBoost releases.

Cheers
Jakob

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions