powered by
Fits a partykit::cforest and displays a multi-panel summary: variable importance barplot, OOB error curve, and optionally a representative tree (the tree with highest prediction agreement with the full ensemble).
partykit::cforest
rf_summary( x = NULL, target_lab = NULL, data_train = NULL, data_test = NULL, data_all = NULL, test_size = 0.3, task = c("classification", "regression"), ntree = 500L, mtry = NULL, rf_control = NULL, show_var_imp = TRUE, show_rep_tree = TRUE, top_n_vars = 15L, total_w = 297, total_h = 210 )
A list (invisible) with:
The fitted cforest object.
cforest
Named numeric vector of variable importance.
Index of the representative tree.
Character. Dataset name/label. If NULL, inferred from data arguments.
Character. Name of the target column.
Data frame. Training data.
Data frame. Test data.
Data frame. Full dataset.
Numeric. Proportion for test split (default 0.3).
Character. "classification" or "regression".
"classification"
"regression"
Integer. Number of trees (default 500).
Integer or NULL. Variables per split.
A ctree_control object or NULL.
ctree_control
Logical. Show variable importance barplot (default TRUE).
Logical. Show representative tree info (default TRUE).
Integer. How many top variables to show (default 15).
Numeric. Page width in mm (default 297).
Numeric. Page height in mm (default 210).
# \donttest{ rf_summary( data_train = train_covid, data_test = test_covid, target_lab = "Outcome", ntree = 50 ) # }
Run the code above in your browser using DataLab