Learn R Programming

dtree (version 0.4.2)

stable: Main function to calculate stability coefficients

Description

Main function to calculate stability coefficients

Usage

stable(formula, data, methods = c("lm", "rpart", "tree", "ctree", "evtree"),
  samp.method = "repeatedcv", tuneLength = 3, n.rep = 100,
  bump.rep = 50, parallel = FALSE, ncore = detectCores() - 1,
  roundVal = 1, stablelearner = FALSE, subset = FALSE, perc.sub = 0.75,
  weights = NULL)

Arguments

formula

a formula, weight a response to left of ~.

data

Data frame to run models on

methods

Which tree methods to use. Defaults: lm, rpart, tree, ctree, evtree. Also can use "rf" for random forests

samp.method

Sampling method. Refer to caret package trainControl() documentation. Default is repeated cross-validation. Other options include "cv" and "boot".

tuneLength

Number of tuning parameters to try. Applies to train()

n.rep

Number of times to replicate each method

bump.rep

Number of repetitions for bumping

parallel

Whether to run all reps in parallel

ncore

Number of cores to use

roundVal

How much to round cut points when calculating stability

stablelearner

Whether or not to use the stablelearner package to calculate stability

subset

Whether to subset

perc.sub

What fraction of data to put into train dataset. 1-frac.sub is allocated to test dataset. Defaults to 0.75

weights

Optional weights for each case.

Examples

Run this code
# NOT RUN {
library(MASS) # for boston data
data(Boston)
stab.out <- stable(formula=medv ~.,data=Boston,
            methods=c("rpart"),samp.method="cv",
            tuneLength=2, n.rep=5, parallel=TRUE)
stab.out
# }

Run the code above in your browser using DataLab