Skip to content

Commit 6bf39b5

Browse files
committed
make error context more informative for ranger prediction (closes #1200)
1 parent 0fbcfd3 commit 6bf39b5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

R/rand_forest_data.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ set_pred(
206206
c(
207207
"`ranger` model does not appear to use class probabilities.",
208208
"i" = "Was the model fit with `probability = TRUE`?"
209-
)
209+
),
210+
call = call2("predict")
210211
)
211212
x
212213
},

tests/testthat/_snaps/rand_forest_ranger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
parsnip:::predict_classprob.model_fit(no_prob_model, new_data = lending_club[1:
2121
6, num_pred])
2222
Condition
23-
Error in `object$spec$method$pred$prob$pre()`:
23+
Error in `predict()`:
2424
! `ranger` model does not appear to use class probabilities.
2525
i Was the model fit with `probability = TRUE`?
2626

0 commit comments

Comments
 (0)