characterize

Inspect structural characteristics of a fitted model, such as the number of active features, the number of terminal notes, and so on.

OTHER License

Stars
6

output: github_document

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

characterize

The goal of characterize is to report data driven characteristics of a model fit that describe the model. For example:

  • the number of predictors used,
  • the number of terminal nodes,

and so on. These are interesting characteristics of the model that often reflect complexity of the model.

Installation

You can install the development version of characterize like so:

require(remotes)
remotes::install_github("topepo/characterize")

Example

This is a basic example which shows you how to solve a common problem:

library(characterize)
library(rpart)

cart_mod <- rpart(mpg ~ ., data = mtcars)
cart_mod

characterize(cart_mod)

# Also some low-level functions: 
.pluck_active_features(cart_mod) %>% 
  tidyr::unnest(value)

Objects with at least one method: r object_list().

Code of Conduct

Please note that the characterize project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.