Skip to content

Commit

Permalink
restrict oobag so that rows_oobag always matches
Browse files Browse the repository at this point in the history
  • Loading branch information
bcjaeger committed Apr 27, 2024
1 parent b53b67d commit c1c9dfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/orsf_R6.R
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ ObliqueForest <- R6::R6Class(
# object and then use this function. We need checks for that case.
new_data <- new_data %||% self$data

# browser()
if(oobag && nrow(new_data) != self$n_obs){
stop("input data must have ", self$n_obs, " observations to ",
"compute out-of-bag predictions.", call. = FALSE)
}

# run checks before you assign new values to object.
# otherwise, if a check throws an error, the object will
Expand Down

0 comments on commit c1c9dfe

Please sign in to comment.