% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SuperSurv-methods.R
\name{event_weights}
\alias{event_weights}
\alias{event_weights.SuperSurv}
\alias{censor_weights}
\alias{censor_weights.SuperSurv}
\title{Access SuperSurv ensemble weights}
\usage{
event_weights(object, ...)

\method{event_weights}{SuperSurv}(object, ...)

censor_weights(object, ...)

\method{censor_weights}{SuperSurv}(object, ...)
}
\arguments{
\item{object}{A fitted object of class \code{"SuperSurv"}.}

\item{...}{Additional arguments ignored.}
}
\value{
A named numeric vector of ensemble weights.
}
\description{
Extracts the fitted event or censoring ensemble weights from a
\code{SuperSurv} object.
}
\examples{
if (requireNamespace("glmnet", quietly = TRUE)) {
  data("metabric", package = "SuperSurv")
  dat <- metabric[1:80, ]
  x_cols <- grep("^x", names(dat))[1:5]
  X <- dat[, x_cols, drop = FALSE]
  new.times <- seq(20, 120, by = 20)

  fit <- SuperSurv(
    time = dat$duration,
    event = dat$event,
    X = X,
    newdata = X,
    new.times = new.times,
    event.library = c("surv.coxph", "surv.ridge"),
    cens.library = c("surv.coxph"),
    control = list(saveFitLibrary = TRUE)
  )

  event_weights(fit)
  censor_weights(fit)
}
}
