Learn R Programming

FFTrees (version 1.8.0)

comp_pred: A wrapper for competing classification algorithms.

Description

comp_pred provides the main wrapper for running alternative classification algorithms, such as CART (rpart::rpart), logistic regression (glm), support vector machines (svm::svm), and random forests (randomForest::randomForest).

Usage

comp_pred(
  formula,
  data.train,
  data.test = NULL,
  algorithm = NULL,
  model = NULL,
  sens.w = NULL,
  new.factors = "exclude"
)

Arguments

formula

A formula (usually x$formula, for an FFTrees object x).

data.train

A training dataset (as data frame).

data.test

A testing dataset (as data frame).

algorithm

character string. An algorithm in the set: "lr" -- logistic regression; "rlr" -- regularized logistic regression; "cart" -- decision trees; "svm" -- support vector machines; "rf" -- random forests.

model

model. An optional existing model, applied to the test data.

sens.w

Sensitivity weight parameter (from 0 to 1, required to compute wacc).

new.factors

string. What should be done if new factor values are discovered in the test set? "exclude" = exclude (i.e.; remove these cases), "base" = predict the base rate of the criterion.