Skip to contents

Random Forest and ensemble methods for clinical research and biomarker discovery. Provides high-accuracy predictions with robust feature importance analysis, out-of-bag error estimation, and clinical interpretation guidelines.

Usage

treeensemble(
  data,
  vars = NULL,
  facs = NULL,
  target,
  targetLevel,
  n_trees = 500,
  mtry_method = "auto",
  mtry_custom = 3,
  min_node_size = 5,
  validation = "oob",
  cv_folds = 5,
  test_split = 0.25,
  importance_type = "permutation",
  feature_selection = FALSE,
  max_features = 10,
  clinical_context = "biomarker",
  class_weights = FALSE,
  show_performance_metrics = TRUE,
  show_importance_plot = TRUE,
  show_oob_error = TRUE,
  show_confusion_matrix = TRUE,
  show_clinical_interpretation = TRUE,
  set_seed = TRUE,
  seed_value = 42
)

Arguments

data

.

vars

.

facs

.

target

.

targetLevel

.

n_trees

.

mtry_method

.

mtry_custom

.

min_node_size

.

validation

.

cv_folds

.

test_split

.

importance_type

.

feature_selection

.

max_features

.

clinical_context

.

class_weights

.

show_performance_metrics

.

show_importance_plot

.

show_oob_error

.

show_confusion_matrix

.

show_clinical_interpretation

.

set_seed

.

seed_value

.

Value

A results object containing:

results$instructionsa html
results$model_summarya html
results$performance_tablea table
results$confusion_matrixa table
results$importance_tablea table
results$importance_plotan image
results$oob_error_plotan image
results$clinical_interpretationa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$performance_table$asDF

as.data.frame(results$performance_table)