Description Usage Arguments Value Examples
Compute decision tree from data set
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
Dataframe or a 'party' or 'partynode' object representing a custom tree. If a dataframe is supplied, conditional inference tree is computed. If a custom tree is supplied, it must follow the partykit syntax: https://cran.r-project.org/web/packages/partykit/vignettes/partykit.pdf |
data_test |
Tidy test dataset. Required if 'x' is a 'partynode' object. If NULL, heatmap displays (training) data 'x'. |
target_lab |
Name of the column in data that contains target/label information. |
task |
Character string indicating the type of problem, either 'classification' (categorical outcome) or 'regression' (continuous outcome). |
feat_types |
Named vector indicating the type of each features, e.g., c(sex = 'factor', age = 'numeric'). If feature types are not supplied, infer from column type. |
label_map |
Named vector of the meaning of the target values, e.g., c(‘0' = ’Edible', ‘1' = ’Poisonous'). |
clust_samps |
Logical. If TRUE, hierarchical clustering would be performed among samples within each leaf node. |
clust_target |
Logical. If TRUE, target/label is included in hierarchical clustering of samples within each leaf node and might yield a more interpretable heatmap. |
custom_layout |
Dataframe with 3 columns: id, x and y for manually input custom layout. |
lev_fac |
Relative weight of child node positions according to their levels, commonly ranges from 1 to 1.5. 1 for parent node perfectly in the middle of child nodes. |
panel_space |
Spacing between facets relative to viewport, recommended to range from 0.001 to 0.01. |
A list of results from 'partykit::ctree' or provided custom tree, including fit, estimates, smart layout and terminal data.
1 2 3 4 | fit_tree <- compute_tree(penguins, target_lab = 'species')
fit_tree$fit
fit_tree$layout
dplyr::select(fit_tree$term_dat, - contains('nodedata'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.