% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrapper.R
\name{surv.aorsf}
\alias{surv.aorsf}
\title{Wrapper for AORSF (Oblique Random Survival Forest)}
\usage{
surv.aorsf(
  time,
  event,
  X,
  newdata,
  new.times,
  obsWeights,
  id,
  n_tree = 500,
  leaf_min_events = 5,
  mtry = NULL,
  ...
)
}
\arguments{
\item{time}{Observed follow-up time; i.e. minimum of the event and censoring times.}

\item{event}{Observed event indicator; i.e, whether the follow-up time corresponds to an event or censoring.}

\item{X}{Training covariate data.frame.}

\item{newdata}{Test covariate data.frame to use for prediction. Should have the same variable names and structure as \code{X}.}

\item{new.times}{Times at which to obtain the predicted survivals.}

\item{obsWeights}{Observation weights.}

\item{id}{Optional cluster/individual ID indicator.}

\item{n_tree}{Number of trees to grow (default: 500).}

\item{leaf_min_events}{Minimum number of events in a leaf node (default: 5).}

\item{mtry}{Number of predictors evaluated at each node.}

\item{...}{Additional arguments passed to \code{\link[aorsf]{orsf}}.}
}
\value{
A list containing:
\itemize{
\item \code{fit}: The fitted model object (e.g., the raw \code{coxph} or \code{xgb.Booster} object).
If the model fails to fit, this may be an object of class \code{try-error}.
\item \code{pred}: A numeric matrix of cross-validated survival predictions
evaluated at the specified \code{new.times} grid.
}
}
\description{
Final Production Wrapper for AORSF (Tunable & Robust).
}
\examples{
if (requireNamespace("aorsf", quietly = TRUE)) {
  data("metabric", package = "SuperSurv")
  dat <- metabric[1:30, ]
  x_cols <- grep("^x", names(dat))[1:3]
  X <- dat[, x_cols, drop = FALSE]
  newX <- X[1:5, , drop = FALSE]
  times <- seq(50, 150, by = 50)

  fit <- surv.aorsf(
    time = dat$duration,
    event = dat$event,
    X = X,
    newdata = newX,
    new.times = times,
    obsWeights = rep(1, nrow(dat)),
    id = NULL,
    n_tree = 10,
    leaf_min_events = 2
  )

  dim(fit[["pred"]])
}
}
