tidy.ggmlr_parsnip_model: Tidy a fitted ggml parsnip model into a per-layer table

View source: R/parsnip_broom.R

tidy.ggmlr_parsnip_modelR Documentation

Tidy a fitted ggml parsnip model into a per-layer table

Description

Returns one row per layer of the underlying sequential network, in broom style. Useful for comparing architectures across experiments in a R Markdown / Quarto report.

Usage

## S3 method for class 'ggmlr_parsnip_model'
tidy(x, ...)

Arguments

x

A fitted 'ggmlr_parsnip_model' (the engine object inside a parsnip fit; e.g. from 'extract_fit_engine()').

...

Unused; for generic compatibility.

Value

A [tibble][tibble::tibble] with columns: 'layer' (name), 'type', 'units' (output units, 'NA' if not applicable), 'activation', 'output_shape' (character), 'params' (trainable parameter count) and 'trainable' (logical).

Examples


ggml_set_n_threads(1L)  # deterministic, single OpenMP pool
spec <- parsnip::mlp(hidden_units = 8L, epochs = 3L) |>
  parsnip::set_engine("ggml", backend = "cpu") |>
  parsnip::set_mode("regression")
fit_obj <- parsnip::fit(spec, mpg ~ ., data = mtcars)
generics::tidy(parsnip::extract_fit_engine(fit_obj))


ggmlR documentation built on July 14, 2026, 1:08 a.m.