Skip to content

[Bug]: xgboost in R  #208

Open
Open
@Forwardlee0

Description

@Forwardlee0

Describe the bug

In R, when I set the learner to "regr.xgboost", I get the following error:
Error in y[] <- lapply(y, reallocate) :
ALTLIST classes must provide a Set_elt method [class: XGBAltrepPointerClass, pkg: xgboost]

My OS is macos and the xgboost package in R was installed via the R CMD INSTALL . instead of the CRAN.

Minimum reproducible code snippet

library(DoubleML)
library(mlr3)
library(mlr3learners)
library(data.table)
set.seed(2)
ml_g = lrn("regr.xgboost", nthread = 2)
ml_m = ml_g$clone()
obj_dml_data = make_plr_CCDDHNR2018(alpha = 0.5)
dml_plr_obj = DoubleMLPLR$new(obj_dml_data, ml_g, ml_m)
dml_plr_obj$fit()
dml_plr_obj$summary()

Expected Result

dml_plr_obj$fit()

Actual Result

Error in y[] <- lapply(y, reallocate) :
ALTLIST classes must provide a Set_elt method [class: XGBAltrepPointerClass, pkg: xgboost]

Versions

sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.1.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Asia/Shanghai
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_4.4.2 tools_4.4.2

packageVersion('DoubleML')
[1] ‘1.0.1’
packageVersion('mlr3')
[1] ‘0.22.1’
packageVersion('xgboost')
[1] ‘2.1.2.1’

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions