@@ -75,6 +75,17 @@ testthat::test_that(
7575 , alpha = c(0 ,1 )
7676 )
7777
78+ initGrid <- data.table(
79+ max_depth = c(1 ,1 ,2 ,2 ,3 ,3 ,4 ,4 ,5 )
80+ , max_leaves = c(2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 )
81+ , min_child_weight = seq(bounds $ min_child_weight [1 ],bounds $ min_child_weight [2 ],length.out = 9 )
82+ , subsample = seq(bounds $ subsample [1 ],bounds $ subsample [2 ],length.out = 9 )
83+ , colsample_bytree = seq(bounds $ colsample_bytree [1 ],bounds $ colsample_bytree [2 ],length.out = 9 )
84+ , gamma = seq(bounds $ gamma [1 ],bounds $ gamma [2 ],length.out = 9 )
85+ , lambda = seq(bounds $ lambda [1 ],bounds $ lambda [2 ],length.out = 9 )
86+ , alpha = seq(bounds $ alpha [1 ],bounds $ alpha [2 ],length.out = 9 )
87+ )
88+
7889 optObj <- bayesOpt(
7990 FUN = scoringFunction
8091 , bounds = bounds
@@ -86,6 +97,17 @@ testthat::test_that(
8697
8798 expect_equal(nrow(optObj $ scoreSummary ),13 )
8899
100+ optObj <- bayesOpt(
101+ FUN = scoringFunction
102+ , bounds = bounds
103+ , initGrid = initGrid
104+ , iters.n = 4
105+ , iters.k = 1
106+ , gsPoints = 10
107+ )
108+
109+ expect_equal(nrow(optObj $ scoreSummary ),13 )
110+
89111 }
90112
91113)
0 commit comments