Skip to content

Commit

Permalink
retry coerce and clean
Browse files Browse the repository at this point in the history
  • Loading branch information
bcjaeger committed Apr 27, 2024
1 parent 3c24b37 commit 6064190
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions R/orsf_R6.R
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ ObliqueForest <- R6::R6Class(
if(is_error(out)) stop(out, call. = FALSE)

# NaNs may occur with oobag = TRUE and small n_tree
# coerce_nans(out, to = NA_real_)
out
coerce_nans(out, to = NA_real_)
# out

},

Expand Down Expand Up @@ -4184,13 +4184,13 @@ ObliqueForestClassification <- R6::R6Class(

},

# clean_pred_oobag_internal = function(){
#
# if(self$pred_type %in% c("prob") && is.matrix(self$pred_oobag)){
# colnames(self$pred_oobag) <- self$class_levels
# }
#
# },
clean_pred_oobag_internal = function(){

if(self$pred_type %in% c("prob") && is.matrix(self$pred_oobag)){
colnames(self$pred_oobag) <- self$class_levels
}

},

predict_internal = function(simplify, oobag){

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-orsf_predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,10 @@ test_that(
predict(fit_standard_penguin_bills$net, oobag = TRUE)
)

# expect_equal(
# fit_standard_penguin_species$custom$pred_oobag,
# predict(fit_standard_penguin_species$custom, oobag = TRUE),
# )
expect_equal(
fit_standard_penguin_species$custom$pred_oobag,
predict(fit_standard_penguin_species$custom, oobag = TRUE)
)

}
)
Expand Down

0 comments on commit 6064190

Please sign in to comment.