Skip to contents

Computes a one-row diagnostic summary for a fitted ci_forest() forest, including ensemble size, tree complexity, observed outcome, fitted prediction, and concentration index of both the observed and fitted outcome.

Usage

ci_forest_summary(object)

Arguments

object

A fitted ci_forest object.

Value

A one-row data.table.

Examples

toy_data <- data.frame(
  rank = c(10, 20, 30, 40, 50, 60),
  outcome = c(1, 0, 1, 0, 1, 1),
  income = c(2, 4, 6, 8, 10, 12)
)
fit <- ci_forest(
  cbind(rank, outcome) ~ income,
  data = toy_data,
  rank_name = "rank",
  outcome_name = "outcome",
  ntree = 3,
  control = ci_tree_control(minsplit = 1, minbucket = 1, maxdepth = 1)
)
ci_forest_summary(fit)
#>    ntree  mtry   type     n mean_outcome mean_prediction outcome_ci
#>    <int> <int> <char> <int>        <num>           <num>      <num>
#> 1:     3    NA     CI     6    0.6666667       0.5555556 0.08333333
#>    prediction_ci mean_terminal_nodes mean_max_depth
#>            <num>               <num>          <num>
#> 1:    0.02777778            1.666667      0.6666667