Create a unified classifier object that wraps various ML algorithms
Usage
create_classifier(
type = "LR",
penalty = "l1",
alpha = NULL,
lambda = NULL,
n_trees = 500,
max_depth = NULL,
kernel = "radial",
seed = NULL,
...
)Arguments
- type
Classifier type: "LR", "RF", "SVM", "NB", "DT", "XGB", "RANGER"
- penalty
For LR: "l1" (lasso), "l2" (ridge), or "elasticnet"
- alpha
For LR: elasticnet mixing parameter (1=lasso, 0=ridge). Default: 1 for L1
- lambda
For LR: regularization strength (smaller = more regularization). If NULL, uses cross-validation to select
- n_trees
For RF/RANGER/XGB: number of trees
- max_depth
For DT/XGB: maximum tree depth
- kernel
For SVM: kernel type ("linear", "radial", "polynomial")
- seed
Random seed for reproducibility
- ...
Additional arguments passed to the underlying classifier