[R] resolve brace_linter warnings (#8564)

This commit is contained in:
James Lamb
2022-12-08 09:01:00 -06:00
committed by GitHub
parent 40a1a2ffa8
commit fbe40d00d8
13 changed files with 31 additions and 20 deletions

View File

@@ -170,8 +170,9 @@ test_that("SHAPs sum to predictions, with or without DART", {
label = y,
nrounds = nrounds)
pr <- function(...)
pr <- function(...) {
predict(fit, newdata = d, ...)
}
pred <- pr()
shap <- pr(predcontrib = TRUE)
shapi <- pr(predinteraction = TRUE)

View File

@@ -17,7 +17,7 @@ test_that("interaction constraints for regression", {
# Set all observations to have the same x3 values then increment
# by the same amount
preds <- lapply(c(1, 2, 3), function(x){
preds <- lapply(c(1, 2, 3), function(x) {
tmat <- matrix(c(x1, x2, rep(x, 1000)), ncol = 3)
return(predict(bst, tmat))
})