crtree: Classification and regression trees based on the rpart...

Description Usage Arguments Details Value See Also Examples

View source: R/crtree.R

Description

Classification and regression trees based on the rpart package

Usage

1
2
3
4
5
crtree(dataset, rvar, evar, type = "", lev = "", wts = "None",
  minsplit = 2, minbucket = round(minsplit/3), cp = 0.001,
  nodes = NA, K = 10, seed = 1234, split = "gini", prior = NA,
  adjprob = TRUE, cost = NA, margin = NA, check = "",
  data_filter = "")

Arguments

dataset

Dataset

rvar

The response variable in the model

evar

Explanatory variables in the model

type

Model type (i.e., "classification" or "regression")

lev

The level in the response variable defined as _success_

wts

Weights to use in estimation

minsplit

The minimum number of observations that must exist in a node in order for a split to be attempted.

minbucket

the minimum number of observations in any terminal <leaf> node. If only one of minbucket or minsplit is specified, the code either sets minsplit to minbucket*3 or minbucket to minsplit/3, as appropriate.

cp

Minimum proportion of root node deviance required for split (default = 0.00001)

nodes

Maximum size of tree in number of nodes to return. If equal to NA no pruning is done

K

Number of folds use in cross-validation

seed

Random seed used for cross-validation

split

Splitting criterion to use (i.e., "gini" or "information")

prior

Adjust the initial probability for the selected level (e.g., set to .5 in unbalanced samples)

adjprob

Setting a prior will rescale the predicted probabilities. Set adjprob to TRUE to adjust the probabilities back to their original scale after estimation

cost

Cost for each connection (e.g., email or mailing)

margin

Margin on each customer purchase

check

Optional estimation parameters (e.g., "standardize")

data_filter

Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")

Details

See https://radiant-rstats.github.io/docs/model/crtree.html for an example in Radiant

Value

A list with all variables defined in crtree as an object of class tree

See Also

summary.crtree to summarize results

plot.crtree to plot results

predict.crtree for prediction

Examples

1
2
3
crtree(titanic, "survived", c("pclass", "sex"), lev = "Yes") %>% summary()
result <- crtree(titanic, "survived", c("pclass", "sex")) %>% summary()
result <- crtree(diamonds, "price", c("carat", "clarity"), type = "regression") %>% str()

radiant-rstats/radiant.model documentation built on Nov. 13, 2018, 7 a.m.