Skip to content

Commit

Permalink
added classprob prediction type
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Jan 29, 2019
1 parent 4a37edb commit 0ca0445
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 16 additions & 2 deletions R/nullmodel_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,28 @@ null_model_parsnip_data <-
defaults = list()
),
class = list(
pre = NULL,
post = NULL,
func = c(fun = "predict"),
args =
list(
object = quote(object$fit),
new_data = quote(new_data),
type = "class"
)
),
classprob = list(
pre = NULL,
post = NULL,
post = function(x, object) {
str(as_tibble(x))
as_tibble(x)
},
func = c(fun = "predict"),
args =
list(
object = quote(object$fit),
new_data = quote(new_data),
type = "class"
type = "prob"
)
),
numeric = list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,4 @@ test_that('classification', {
expect_true(!is.null(null_model$fit))
})


0 comments on commit 0ca0445

Please sign in to comment.