[R] Error out on multidimensional arrays (#9852)
This commit is contained in:
@@ -297,3 +297,11 @@ test_that("xgb.DMatrix: Inf as missing", {
|
||||
file.remove("inf.dmatrix")
|
||||
file.remove("nan.dmatrix")
|
||||
})
|
||||
|
||||
test_that("xgb.DMatrix: error on three-dimensional array", {
|
||||
set.seed(123)
|
||||
x <- matrix(rnorm(500), nrow = 50)
|
||||
y <- rnorm(400)
|
||||
dim(y) <- c(50, 4, 2)
|
||||
expect_error(xgb.DMatrix(data = x, label = y))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user