Package: MTLR 0.2.1

Humza Haider
MTLR: Survival Prediction with Multi-Task Logistic Regression
An implementation of Multi-Task Logistic Regression (MTLR) for R. This package is based on the method proposed by Yu et al. (2011) which utilized MTLR for generating individual survival curves by learning feature weights which vary across time. This model was further extended to account for left and interval censored data.
Authors:
MTLR_0.2.1.tar.gz
MTLR_0.2.1.tar.gz(r-4.5-noble)MTLR_0.2.1.tar.gz(r-4.4-noble)
MTLR_0.2.1.tgz(r-4.4-emscripten)MTLR_0.2.1.tgz(r-4.3-emscripten)
MTLR.pdf |MTLR.html✨
MTLR/json (API)
NEWS
# Install 'MTLR' in R: |
install.packages('MTLR', repos = 'https://cloud.r-project.org') |
Bug tracker:https://github.com/haiderstats/mtlr/issues1 issues
Last updated 6 years agofrom:bf6078aa87. Checks:3 OK. Indexed: no.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 25 2025 |
R-4.5-linux-x86_64 | OK | Mar 25 2025 |
R-4.4-linux-x86_64 | OK | Mar 25 2025 |
Exports:create_foldsmtlrmtlr_cvplotcurves
Dependencies:latticeMatrixRcppRcppArmadillosurvival
Citation
To cite package ‘MTLR’ in publications use:
Haider H (2019). MTLR: Survival Prediction with Multi-Task Logistic Regression. R package version 0.2.1, https://CRAN.R-project.org/package=MTLR.
ATTENTION: This citation information has been auto-generated from the package DESCRIPTION file and may need manual editing, see ‘help("citation")’.
Corresponding BibTeX entry:
@Manual{, title = {MTLR: Survival Prediction with Multi-Task Logistic Regression}, author = {Humza Haider}, year = {2019}, note = {R package version 0.2.1}, url = {https://CRAN.R-project.org/package=MTLR}, }
Readme and manuals
MTLR
The goal of MTLR
is to provide an R implementation for Multi-Task Logistic Regression. In addition to supplying the model provided by Yu et al. we have extended the model for left censoring, interval censoring, and a mixture of censoring types. Functionality includes training an MTLR model, predicting survival curves for new observations, and plotting these survival curves and feature weights estimated by MTLR.
Installation
You can install the version from CRAN or the development version from GitHub:
# CRAN:
install.packages("MTLR")
# GitHub:
# install.packages("devtools")
devtools::install_github("haiderstats/MTLR")
Example
Given a survival dataset containing event time and event status indicator (censored/uncensored) we can produce an MTLR model. For example, consider the lung
dataset from the survival
package:
# Load survival for the lung dataset and the Surv() function.
library(survival)
#Here we will use 9 intervals (10 time points) just for plotting purposes.
#The default is sqrt the number of observations.
mod <- mtlr(Surv(time,status)~., data = lung, nintervals = 9)
print(mod)
#>
#> Call: mtlr(formula = Surv(time, status) ~ ., data = lung, nintervals = 9)
#>
#> Time points:
#> [1] 62.3 145.4 179.3 210.4 241.4 284.5 308.2 383.5 476.3 642.8
#>
#>
#> Weights:
#> Bias inst age sex ph.ecog ph.karno pat.karno meal.cal wt.loss
#> 62.27 0.1147 -0.017981 0.04891 -0.01249 0.00461 -0.00648 0.01352 -0.02617 -0.01325
#> 145.36 0.1362 -0.021147 0.03275 -0.00473 0.02312 -0.02227 -0.01753 -0.01105 -0.02974
#> 179.27 0.2119 -0.008203 0.02260 -0.02564 0.02394 -0.02046 -0.03161 -0.02310 -0.02218
#> 210.36 0.0398 0.000359 0.00816 -0.03638 0.04704 -0.02230 -0.04129 -0.01410 -0.03367
#> 241.36 -0.0996 0.009570 -0.01581 -0.04405 0.06690 -0.04139 -0.05453 -0.00808 -0.01288
#> 284.55 -0.2299 0.004869 -0.00476 -0.05180 0.04824 -0.02107 -0.03135 0.00237 -0.02552
#> 308.18 -0.3012 -0.007743 -0.00467 -0.05426 0.04908 -0.02280 -0.03264 -0.01608 0.02130
#> 383.45 -0.0289 -0.019985 -0.01030 -0.03263 0.02868 -0.00680 -0.02321 -0.01458 -0.00235
#> 476.27 -0.1285 -0.010232 0.00106 -0.02226 0.01715 0.01699 -0.01555 -0.02112 -0.01587
#> 642.82 -0.3513 -0.014975 0.02291 -0.02548 0.01847 0.00556 -0.00856 0.00373 -0.00552
#Plot feature weights:
plot(mod)

#Get survival curves for the lung dataset:
curves <- predict(mod)
#Plot the first 20 survival curves:
plotcurves(curves, 1:20)

Help Manual
Help page | Topics |
---|---|
Create folds for cross-validation. | create_folds |
Train a Multi-Task Logistic Regression (MTLR) Model | mtlr |
MTLR Internal Cross-Validation for Selecting C1. | mtlr_cv |
Graphical Representation of Feature Weights | plot.mtlr |
Graphically Visualize MTLR Survival Curves | plotcurves |
Predictions for MTLR | predict.mtlr |
Printing an MTLR object. | print.mtlr |