← Back to all sparks
O

offsetreg

INFRA · APIS
Velocity0.0

An Extension of Tidymodels Supporting Offset Terms

The parsnip extension for exposure models grew from one algorithm to three

tidymodelsparsnipr-packageactuarialoffset-modelsmachine-learning
Current state
offsetreg supplies parsnip model specifications for regressions with offsets, the form actuarial and epidemiological work needs when modelling rates over exposure. It launched with a single specification, poisson_reg_offset(), backed by glm and glmnet engines. Version 1.1.0 added two more model types - boost_tree_offset() for boosted trees via xgboost and decision_tree_exposure() for weighted decision trees via rpart - and 1.2.0 has been consolidation: argument passthrough to the underlying glm and glmnet calls, an xgboost 3.0 minimum with API accommodation, and cli-formatted messages.
Where it's heading
The package is following the tidymodels extension playbook: establish one model type, then add types rather than engines, and keep pace with parsnip's own releases. Each version has also tightened the guardrails around correct use - a vignette on when offsetreg should and should not be used, check_args() methods on the specifications - which suggests the maintainer is fielding misapplication rather than feature requests.
Prediction
Expect additional engines under the existing model types, or a fourth specification, before any change to the offset handling itself, since the package's structure invites extension at the engine layer.

Recent moves

  1. 4mo ago

    Argument passthrough to glm and glmnet, xgboost 3.0 minimum

    Lets additional named arguments reach stats::glm() and glmnet::glmnet() through the offset wrappers, which removes a common reason to drop out of the parsnip interface. The xgboost 3.0 requirement and its API accommodation are the maintenance cost of having taken on a boosted-tree engine in the previous release.

    View source ↗
  2. 1y ago

    Boosted trees and weighted decision trees join the offset model family

    ⚡ SPARK

    The release note bundles a routine parsnip 1.3.0 compatibility bump with the 1.1.0 notes, where the real content sits. Going from one model specification to three is what turned offsetreg from a glm wrapper into an extension package with a family of methods behind a common interface.

    View source ↗
  3. 2y ago

    Initial release with Poisson regression over offsets

    The founding release: one model specification, poisson_reg_offset(), wrapping stats::glm() and glmnet::glmnet() as two engines. A narrow starting point that the tree specifications a year later would widen considerably.

    View source ↗