dtree: Create a decision tree

dtreeR Documentation

Create a decision tree

Description

Create a decision tree

Usage

dtree(yl, opt = "max", base = character(0), envir = parent.frame())

Arguments

yl

A yaml string or a list (e.g., from yaml::yaml.load_file())

opt

Find the maximum ("max") or minimum ("min") value for each decision node

base

List of variable definitions from a base tree used when calling a sub-tree

envir

Environment to extract data from

Details

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

Value

A list with the initial tree, the calculated tree, and a data.frame with results (i.e., payoffs, probabilities, etc.)

See Also

summary.dtree to summarize results

plot.dtree to plot results

sensitivity.dtree to plot results

Examples

yaml::as.yaml(movie_contract) %>% cat()
dtree(movie_contract, opt = "max") %>% summary(output = TRUE)
dtree(movie_contract)$payoff
dtree(movie_contract)$prob
dtree(movie_contract)$solution_df


radiant.model documentation built on Oct. 16, 2023, 9:06 a.m.