Skip to content

Commit 618c6bd

Browse files
committed
allow plot_min_depth_distribution to work on ranger forests directly
1 parent 3a5f906 commit 618c6bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

R/min_depth_distribution.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ plot_min_depth_distribution <- function(min_depth_frame, k = 10, min_no_of_trees
143143
mean_sample = "top_trees", mean_scale = FALSE, mean_round = 2,
144144
main = "Distribution of minimal depth and its mean"){
145145
minimal_depth <- NULL; mean_minimal_depth_label <- NULL; mean_minimal_depth <- NULL
146-
if("randomForest" %in% class(min_depth_frame)){
146+
if(any(c("randomForest", "ranger") %in% class(min_depth_frame))){
147147
min_depth_frame <- min_depth_distribution(min_depth_frame)
148148
}
149149
min_depth_count_list <- min_depth_count(min_depth_frame)

0 commit comments

Comments
 (0)