Skip to content

Commit

Permalink
fix: prevent defunct loss parameter values during regression tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jemus42 committed Nov 17, 2023
1 parent 249090b commit 9db1f77
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/rpf.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ rpf_bridge <- function(processed, max_interaction = 1, ntrees = 50, splits = 30,
checkmate::assert_number(delta, lower = 0, upper = 1)
checkmate::assert_number(epsilon, lower = 0, upper = 1)

# "median" is implemented but discarded
checkmate::assert_choice(
loss,
choices = c("L1", "L2", "logit", "exponential")
# "median" loss is implemented but discarded
loss_functions <- switch(outcomes$mode,
"regression" = "L2",
"classification" = c("L1", "L2", "logit", "exponential")
)
checkmate::assert_choice(loss, choices = loss_functions)

checkmate::assert_flag(deterministic)
checkmate::assert_int(nthreads, lower = 1L)
Expand Down

0 comments on commit 9db1f77

Please sign in to comment.