% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PredictionTable.R
\name{as_prediction_table}
\alias{as_prediction_table}
\title{Convert to prediction table object}
\usage{
as_prediction_table(
  x,
  type,
  y = waiver(),
  batch_id = waiver(),
  sample_id = waiver(),
  series_id = waiver(),
  repetition_id = waiver(),
  time = waiver(),
  class_levels = waiver(),
  value_range = waiver(),
  event_indicator = waiver(),
  censoring_indicator = waiver(),
  learner = waiver(),
  vimp_method = waiver(),
  model_object = NULL,
  data = NULL
)
}
\arguments{
\item{x}{Values predicted using a learner. For all but \code{classification}
problems, predicted values should be a single vector of values in any
format that results in a single-column \code{data.table} using
\code{data.table::as.data.table}. For \code{classification} problems, predicted
values are probabilities for each class. Here, it is recommended to ensure
probabilities can be mapped to their respective class, e.g. using a named
list.}

\item{type}{The type of prediction table that should be created. The
following types are available:
\itemize{
\item \code{regression}: The predicted values are values for a regression.
\item \code{classification}: The predicted values are probabilities for specific
classes.
\item \code{hazard_ratio}: The predicted values are hazard ratios.
\item \code{cumulative_hazard}: The predicted values are cumulative hazards at
time \code{time}.
\item \code{expected_survival_time}: The predicted values are expected survival times.
\item \code{survival_probability}: The predicted values are survival probabilities
at time \code{time}.
}}

\item{y}{Known outcome value corresponding to each entry in \code{x}. For
survival-related outcomes, two sets of values are expected, corresponding
to the observed time and event status, respectively. Alternatively, a
\code{survival::Surv} object can be provided.}

\item{batch_id}{(\emph{optional}) Array of batch or cohort identifiers.

In familiar any row of data is organised by four identifiers:
\itemize{
\item The batch identifier \code{batch_id}: This denotes the group to which a
set of samples belongs, e.g. patients from a single study, samples measured
in a batch, etc. The batch identifier is used for batch normalisation, as
well as selection of development and validation datasets.
\item The sample identifier \code{sample_id}: This denotes the sample level,
e.g. data from a single individual. Subsets of data, e.g. bootstraps or
cross-validation folds, are created at this level.
\item The series identifier \code{series_id}: Indicates measurements on a
single sample that may not share the same outcome value, e.g. a time
series, or the number of cells in a view.
\item The repetition identifier \code{repetition_id}: Indicates repeated measurements
in a single series where any feature values may differ, but the outcome
does not. Repetition identifiers are always implicitly set when multiple
entries for the same series of the same sample in the same batch that share
the same outcome are encountered.
}}

\item{sample_id}{(\emph{optional}) Array of sample or subject identifiers. See
\code{batch_id} above for more details.

If unset, every row will be identified as a single sample.}

\item{series_id}{(\emph{optional}) Array of series identifiers, which distinguish
between measurements that are part of a series for a single sample. See
\code{batch_id} above for more details.}

\item{repetition_id}{(\emph{optional}) Array of repetition identifiers, which
distinguishes between repeated measurements within a single series. See
\code{batch_id} above for more details.}

\item{time}{Time point at which the predicted values are generated e.g. the
cumulative risks generated by random forest.

This parameter is only relevant for \code{survival} outcomes.}

\item{class_levels}{(\emph{optional}) Class levels for \code{binomial} or \code{multinomial}
outcomes. This argument can be used to specify the ordering of levels for
categorical outcomes. These class levels must exactly match the levels
present in the outcome column.}

\item{value_range}{Range of observed, \strong{not predicted}, values.

This parameter is only relevant for \code{continuous} outcomes.}

\item{event_indicator}{(\strong{recommended}) Indicator for events in \code{survival}
and \code{competing_risk} analyses. \code{familiar} will automatically recognise \code{1},
\code{true}, \code{t}, \code{y} and \code{yes} as event indicators, including different
capitalisations. If this parameter is set, it replaces the default values.}

\item{censoring_indicator}{(\strong{recommended}) Indicator for right-censoring in
\code{survival} and \code{competing_risk} analyses. \code{familiar} will automatically
recognise \code{0}, \code{false}, \code{f}, \code{n}, \code{no} as censoring indicators, including
different capitalisations. If this parameter is set, it replaces the
default values.}

\item{learner}{The type of learner that generated the predictions.}

\item{vimp_method}{The type of variable importance method for identifying the
features included by the learner that generated the predictions.}

\item{model_object}{A familiarModel or familiarEnsemble that can be used (and
is used internally) for setting several of the other arguments of this
function.}

\item{data}{A familiar dataObject object that can be used (and is used
internally) for setting many of the other arguments of this function.}
}
\value{
A prediction table object.
}
\description{
Creates a prediction table object from input data.
}
