[R] resolve brace_linter warnings (#8564)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user