Learn R Programming

dtGAP (version 0.0.2)

compare_dtGAP: Compare Multiple Decision Tree Models Side-by-Side

Description

Runs the dtGAP pipeline for each specified model and composes the results side-by-side on a single wide page. Shared data preparation is performed once; each model gets its own tree + heatmap panel.

Usage

compare_dtGAP(
  models = c("rpart", "party"),
  data_train = NULL,
  data_test = NULL,
  data_all = NULL,
  target_lab = NULL,
  show = c("all", "train", "test"),
  test_size = 0.3,
  task = c("classification", "regression"),
  total_w = 594,
  total_h = 210,
  ...
)

Value

Draws the side-by-side comparison to the current graphics device. Called for its side effect; returns invisibly.

Arguments

models

Character vector of length >= 2. Models to compare. Each must be one of "rpart", "party", "C50", or "caret".

data_train

Data frame. Training data.

data_test

Data frame. Test data.

data_all

Data frame. Full dataset (alternative to separate train/test).

target_lab

Character. Name of the target column.

show

Character. Which subset to show: "all", "train", or "test".

test_size

Numeric. Proportion for test split (default 0.3).

task

Character. "classification" or "regression".

total_w

Numeric. Total page width in mm (default 594, 2x A4 width).

total_h

Numeric. Total page height in mm (default 210).

...

Additional visual parameters passed to each dtGAP panel (e.g. trans_type, col_proximity, print_eval).

Examples

Run this code
# \donttest{
compare_dtGAP(
  models = c("rpart", "party"),
  data_all = Psychosis_Disorder,
  target_lab = "UNIQID",
  show = "all",
  trans_type = "none",
  print_eval = FALSE
)
# }

Run the code above in your browser using DataLab