Skip to contents

Produces a styled gt table of model coefficients. Supports linear, polynomial, logistic, ridge, lasso, and elastic net models. The numbers come from tl_coefficients, which returns them as a tibble if you would rather format them yourself.

Usage

tl_table_coefficients(
  model,
  lambda = "1se",
  digits = 4,
  conf_int = FALSE,
  level = 0.95,
  exponentiate = FALSE,
  ...
)

Arguments

model

A tidylearn model object

lambda

For regularised models: "1se" (default), "min", or a numeric penalty within the fitted path

digits

Number of decimal places (default: 4)

conf_int

Whether to add a confidence interval (default: FALSE). Not available for regularised models.

level

Confidence level for the interval (default: 0.95)

exponentiate

Whether to report odds ratios rather than log odds (default: FALSE). Classification models only.

...

Additional arguments (currently unused)

Value

A gt table object.

See also

tl_coefficients for the underlying tibble.

Examples

# \donttest{
model <- tl_model(mtcars, mpg ~ wt + hp, method = "linear")
tl_table_coefficients(model)
Linear Model Coefficients
Term Estimate Std. Error t value p
(Intercept) 37.2273 1.5988 23.2847 2.57 × 10−20 *
wt −3.8778 0.6327 −6.1287 1.12 × 10−6 *
hp −0.0318 0.0090 −3.5187 1.45 × 10−3 *
tidylearn | linear (regression) | mpg ~ wt + hp | n = 32
tl_table_coefficients(model, conf_int = TRUE)
Linear Model Coefficients
Wald 95% intervals
Term Estimate Std. Error Lower 95% Upper 95% t value p
(Intercept) 37.2273 1.5988 33.9574 40.4972 23.2847 2.57 × 10−20 *
wt −3.8778 0.6327 −5.1719 −2.5837 −6.1287 1.12 × 10−6 *
hp −0.0318 0.0090 −0.0502 −0.0133 −3.5187 1.45 × 10−3 *
tidylearn | linear (regression) | mpg ~ wt + hp | n = 32
# }