Skip to contents

Collect tuning metrics

Usage

ci_collect_metrics(
  x,
  summarize = TRUE,
  metric = NULL,
  ...,
  selected = NULL,
  format = c("default", "tidy", "wide"),
  include_train = TRUE
)

Arguments

x

A tuning object returned by tune_ci_tree() or tune_ci_forest().

summarize

Logical; return grid-level summaries when TRUE, or fold-level metrics when FALSE. Ignored when format = "tidy".

metric

Optional metric name used to filter the result.

...

Reserved for future extensions.

selected

Optional tuning summary rows, typically from ci_select_best(), used to filter the returned metrics to selected type/grid_id combinations.

format

Output format. "default" preserves the package's original summary or fold-level table. "tidy" returns a tidymodels-like table with grid columns followed by .metric, .estimator, mean, n, std_err, .dataset, and .config. "wide" returns one row per tuning setting with metric columns such as mean_validation_gain and std_err_train_gain.

include_train

Logical; for format = "tidy" or "wide", include training diagnostic rows when the tuning object contains training diagnostics.

Value

A data.table.