File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
# test grid search
2
- test_that(' grid_search' ,{
2
+ test_that(' grid_search iterator ' ,{
3
3
set.seed(' 57475' )
4
4
# dataset
5
5
D = iris_dataset()
@@ -20,7 +20,27 @@ test_that('grid_search',{
20
20
})
21
21
22
22
# test grid search
23
- test_that(' grid_search' ,{
23
+ test_that(' grid_search wf' ,{
24
+ set.seed(' 57475' )
25
+ # dataset
26
+ D = iris_dataset()
27
+ # iterator
28
+ I = grid_search_1d(param_to_optimise = ' number_components' ,
29
+ factor_name = ' Species' ,
30
+ search_values = 1 : 4 ,
31
+ model_index = 2 ,
32
+ max_min = ' min' )*
33
+ (mean_centre()+ PLSDA())
34
+ # metric
35
+ B = balanced_accuracy()
36
+ # run
37
+ I = run(I ,D ,B )
38
+ # calculate metric
39
+ expect_equal(I $ metric $ value [1 ],0.320 )
40
+ })
41
+
42
+ # test grid search
43
+ test_that(' grid_search chart' ,{
24
44
set.seed(' 57475' )
25
45
# dataset
26
46
D = iris_dataset()
You can’t perform that action at this time.
0 commit comments