% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predictRisk.R
\name{predictRisk.base_learner}
\alias{predictRisk.base_learner}
\title{Absolute-risk matrix predictions for a fitted base learner}
\usage{
\method{predictRisk}{base_learner}(object, newdata, times, cause = 1, ...)
}
\arguments{
\item{object}{\code{base_learner}. Fitted object from \code{\link[=fit_learner]{fit_learner()}}.}

\item{newdata}{\code{data.frame}. New covariate data.}

\item{times}{\code{numeric}. Prediction times.}

\item{cause}{\code{numeric(1)}. Cause index.}

\item{...}{Unused.}
}
\value{
\code{numeric} matrix with \code{nrow(newdata)} rows and \code{length(times)} columns.
}
\description{
Absolute-risk matrix predictions for a fitted base learner
}
\examples{
d <- simulateStenoT1(30, competing_risks = TRUE)
lrn <- Learner_glmnet(
  covariates = c("sex", "value_LDL"),
  lambda = 0.01,
  cross_validation = FALSE
)
bl <- fit_learner(
  d,
  learner = lrn,
  id = "id",
  status = "status_cvd",
  event_time = "time_cvd",
  number_of_nodes = 3
)

if (requireNamespace("riskRegression", quietly = TRUE)) {
  riskRegression::predictRisk(bl, newdata = d[1:3], times = c(1, 3), cause = 1)
}


}
