@@ -28,12 +28,6 @@ lr_fit_2 <-
2828 set_engine(" glm" ) %> %
2929 fit(Ozone ~ . , data = class_dat2 )
3030
31- lr_fit_3 <-
32- mlp(mode = ' classification' ) %> %
33- set_engine(" nnet" ) %> %
34- fit(Ozone ~ . , data = class_dat2 [1 : 5 , ])
35-
36-
3731# ------------------------------------------------------------------------------
3832
3933test_that(' regression predictions' , {
@@ -60,11 +54,8 @@ test_that('non-standard levels', {
6054
6155 expect_true(is_tibble(predict(lr_fit_2 , new_data = class_dat2 [1 : 5 ,- 1 ], type = " prob" )))
6256 expect_true(is_tibble(parsnip ::: predict_classprob.model_fit(lr_fit_2 , new_data = class_dat2 [1 : 5 ,- 1 ])))
63- final_colnames <- c(" .pred_2low" , " .pred_high+values" )
6457 expect_equal(names(predict(lr_fit_2 , new_data = class_dat2 [1 : 5 ,- 1 ], type = " prob" )),
65- final_colnames )
66- expect_equal(names(predict(lr_fit_3 , new_data = class_dat2 , type = ' prob' )),
67- final_colnames )
58+ c(" .pred_2low" , " .pred_high+values" ))
6859 expect_equal(names(parsnip ::: predict_classprob.model_fit(lr_fit_2 , new_data = class_dat2 [1 : 5 ,- 1 ])),
6960 c(" 2low" , " high+values" ))
7061})
0 commit comments