register_engine: Register a custom modeling engine

View source: R/engine-registry.R

register_engineR Documentation

Register a custom modeling engine

Description

Allows third-party packages to register custom engines with fit_model(). This enables an extensible plugin architecture similar to 'parsnip' engine registration.

Usage

register_engine(
  name,
  fit_fn,
  description = "",
  type = "frequentist",
  time_varying = FALSE
)

Arguments

name

Engine name (character scalar).

fit_fn

Function with signature ⁠function(data, pivot, ci_level, ...)⁠. Must return a list compatible with lfq_fit structure.

description

One-line description of the engine.

type

"frequentist" or "bayesian".

time_varying

Logical; does the engine support time-varying growth advantages?

Value

Invisibly returns the updated engine registry.

Examples

# Register a custom engine
my_engine <- function(data, pivot = NULL, ci_level = 0.95, ...) {
  # Custom implementation...
  .engine_mlr(data, pivot = pivot, ci_level = ci_level, ...)
}
register_engine("my_mlr", my_engine, "Custom MLR wrapper")
lfq_engines()


lineagefreq documentation built on April 3, 2026, 9:09 a.m.