Penalized Transformation Models
Overview
Partially penalized versions of specific transformation models implemented in package 'mlt'. Available models include a fully parametric version of the Cox model, other parametric survival models (Weibull, etc.), normal and transformed-normal (Box-Cox type) linear models, and continuous outcome logistic regression. Models can be specified via a formula interface. Hyperparameter tuning is facilitated through model-based optimization functionalities from package 'mlr3mbo'. The accompanying vignette describes the methodology used in 'tramnet' in detail. Transformation models and model-based optimization are described in Hothorn et al. (2019) doi:10.1111/sjos.12291 and Bischl et al. (2017) doi:10.48550/arXiv.1703.03373, respectively.
New features
tramnet()is now an S3 generic. The existing interface, taking an unpenalizedtrammodel and a design matrix, is available astramnet.default()and remains unchanged.- New formula interface
tramnet.formula(), the penalized analogue oftram::tram(), together with the convenience wrappersCoxphnet(),Colrnet(),Lmnet(),BoxCoxnet(),Lehmannnet()andSurvregnet(). The design matrix is set up and scaled internally, and the scaling of the training data is re-used fornewdatain all methods and incvl_tramnet(). coef()gains argumentscaled. For models fitted via the formula interface, coefficients are reported on the original scale of the covariates by default.
Show all changes in 0.1-0Hide the rest of the changes in 0.1-0
- New
model.matrix()method. mbo_recommended()additionally accepts a fitted"tramnet"object.- Case weights and offsets are now taken into account when fitting.
Changes
- Model-based optimization now uses package 'mlr3mbo' instead of the retired package 'mlrMBO'. Function names and arguments of
mbo_tramnet(),elnet_obj(),lasso_obj(),ridge_obj()andmbo_recommended()are unchanged, but the default ofopt_critis now"ei",mbo_tramnet()returns a list and the objective functions are of classbbotk::ObjectiveRFun. - Tests use 'testthat'.
- Removed unused dependencies ('mlbench', 'utils') and the unused internal function
.plot_cvl(). The package description no longer mentions models for binary and ordered categorical responses, which cannot be fitted.
Bug fixes
logLik(object, newdata)now returns the out-of-sample log-likelihood without subtracting the penalty of the training fit. Consequently,cvl_tramnet()andmbo_tramnet()tunelambdaandalphabased on the unpenalized out-of-sample log-likelihood (log score), which previously favoured small values oflambda.- The quadratic part of the penalty was erroneously scaled by
lambda^2instead oflambdain the objective function. The penalty is nowlambda * (0.5 * (1 - alpha) * ||beta||_2^2 + alpha * ||beta||_1), as documented and as in 'glmnet', and coincides with the penalty subtracted inlogLik(). Fits withalpha < 1andlambdadifferent from 0 and 1 change. predict(),simulate(),plot(),residuals()andestfun()now use the correct sign of the shift term for models withnegative = TRUE, such asLm(),BoxCox(),Lehmann()andSurvreg().plot_path()no longer warns when restoring graphical parameters.predict(),simulate()andplot()work with non-syntactic column names of the design matrix (e.g., interactions orlog(x)).prof_lambda(),prof_alpha()andcvl_tramnet(..., fit_opt = TRUE)refit models directly instead of re-evaluating the original call, which failed when the baseline model or the design matrix were not visible from the global environment.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-18
- ERROR12 OK, 2 ERROR2026-03-10
Documentation
- Help pages
- 23
- Examples that run
- 0%8 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 64%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
- tramnet PDF
Downloads
Repository
Repository codeberg.org/lucaskook/tramnet is linked, but repository-practices checks have not run for it yet. Checks are GitHub-only for now.
Dependencies
Installing tramnet adds 68 packages (39 with compiled code, 58 MB of source tarballs). Heaviest: TH.data 8.2 MB, clarabel 5.7 MB, data.table 5.7 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.1-0Latest2026-10-16 · current release · diff ↗ ·
added 6 exports
BoxCoxnet, Colrnet, Coxphnet, Lehmannnet, Lmnet, Survregnet - RR 4.6.0 released · 2026-04-24
- 0.0-9912026-03-10 · diff ↗
- 0.0-992026-03-06 · diff ↗
- 0.0-102025-11-18 · diff ↗
- 0.0-92025-10-08 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.0-82023-03-10 · diff ↗
- 0.0-72022-08-22 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.0-62021-07-19 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.0-52021-03-16 · diff ↗
- 0.0-42021-03-15 · diff ↗
Package metadata
- First published
- 2020-03-20
- Total releases
- 12 / 6 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 4.2.0
- Download size
- 1.5 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("tramnet")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.