Package 'survivalisttoo'

Title: Model-Agnostic Survival Analysis
Description: Model-agnostic survival analysis: using any Machine learning algorithm for doing survival analysis.
Authors: T. Moudiki [aut, cre]
Maintainer: T. Moudiki <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-06-05 06:31:57 UTC
Source: https://github.com/Techtonique/survivalisttoo

Help Index


Model-Agnostic Survival Analysis

Description

Model-agnostic survival analysis: using any Machine learning algorithm for doing survival analysis.

Package Content

Index of help topics:

cox_gradient_boost      Cox Gradient Boosting Model
predict.CoxGradientBoost
                        Predict from a CoxGradientBoost model
print.CoxGradientBoost
                        Print a CoxGradientBoost Object
survivalisttoo-package
                        Model-Agnostic Survival Analysis

Maintainer

T. Moudiki <[email protected]>

Author(s)

T. Moudiki [aut, cre]


Cox Gradient Boosting Model

Description

Fit a model-agnostic Cox-gradient boosting survival model

Usage

cox_gradient_boost(
  X,
  time,
  event,
  regr_fun,
  M = 100L,
  nu = 0.1,
  show_progress = TRUE,
  ...
)

Arguments

X

numeric matrix of covariates (n x p)

time

numeric vector of observed times

event

integer/logical vector (1 = event, 0 = censored)

regr_fun

function(X, y, ...) -> model with predict() method

M

number of boosting iterations (default 100)

nu

learning rate / shrinkage (default 0.1)

show_progress

logical; print a progress bar? (default TRUE)

...

extra arguments forwarded to regr_fun at every iteration

Value

object of class "CoxGradientBoost"

Examples

require(glmnet)
require(survival)

data(ovarian)

set.seed(42)
idx_train <- sample(nrow(ovarian), floor(0.75 * nrow(ovarian)))
df <- ovarian
train <- df[idx_train, ]; test <- df[-idx_train, ]

regr_lm <- function(X, y, ...) lm(y ~ ., data = data.frame(X, y = y))

fit_boost_lm <- survivalisttoo::cox_gradient_boost(train, train$futime, 
train$fustat, regr_lm)

y_test   <- Surv(test$futime, test$fustat)
(ci_blm <- glmnet::Cindex(predict(fit_boost_lm, test), y_test)) # C-index

Predict from a CoxGradientBoost model

Description

Predict from a CoxGradientBoost model

Usage

## S3 method for class 'CoxGradientBoost'
predict(object, newdata, type = "lp", times = NULL, M = NULL, ...)

Arguments

object

a CoxGradientBoost object

newdata

numeric matrix or data.frame of new covariates

type

"lp" (default), "survival", or "cumhaz"

times

time grid for type != "lp"; NULL -> training event times

M

use only the first M base learners (early stopping probe); NULL -> all M (default)

...

unused

Value

type = "lp" -> numeric vector (length n_new) type = "survival" -> matrix (n_new x length(times)) type = "cumhaz" -> matrix (n_new x length(times))


Print a CoxGradientBoost Object

Description

Displays a concise summary of a fitted CoxGradientBoost model, including the base learner, number of boosting iterations, learning rate, and basic information about the training data.

Usage

## S3 method for class 'CoxGradientBoost'
print(x, ...)

Arguments

x

An object of class "CoxGradientBoost".

...

Further arguments passed to or from other methods (currently unused).

Details

This method prints key characteristics of the fitted model:

  • The base learner used in boosting

  • The number of boosting iterations (MM)

  • The learning rate (ν\nu)

  • The number of observations

  • The number of observed events

  • The number of unique event times

Value

The input object x, invisibly.

See Also

cox_gradient_boost, predict.CoxGradientBoost