Learn R Programming

treeheatr (version 0.2.1)

eval_tree: Print decision tree performance according to different metrics.

Description

Print decision tree performance according to different metrics.

Usage

eval_tree(
  dat,
  target_lab = colnames(dat)[1],
  task = c("classification", "regression"),
  metrics = NULL
)

Arguments

dat

Dataframe with truths (column `target_lab`) and estimates (column `y_hat`) of samples from original dataset.

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).

metrics

A set of metric functions to evaluate decision tree, defaults to common metrics for classification/regression problems. Can be defined with `yardstick::metric_set`.

Value

Character string of the decision tree evaluation.

Examples

Run this code
# NOT RUN {
eval_tree(compute_tree(penguins, target_lab = 'species')$dat)

# }

Run the code above in your browser using DataLab