% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transform_sample_model_out.R
\name{transform_sample_model_out}
\alias{transform_sample_model_out}
\title{Transform sample model output into a forecast object}
\usage{
transform_sample_model_out(
  model_out_tbl,
  oracle_output,
  compound_taskid_set = NULL
)
}
\arguments{
\item{model_out_tbl}{Model output tibble with predictions}

\item{oracle_output}{Predictions that would have been generated by an oracle
model that knew the observed target data values in advance}

\item{compound_taskid_set}{Character vector of task ID column names that
stay constant within each sample draw (i.e., define the compound modeling
task grouping). When \code{NULL} (the default), each modeling task is scored
independently (marginal scoring). When provided, sample draws are treated
as joint predictions across the task ID dimensions \strong{not} in
\code{compound_taskid_set}, and multivariate scoring metrics are used.}
}
\value{
A \code{forecast_sample} object (when \code{compound_taskid_set} is \code{NULL})
or a \code{forecast_multivariate_sample} object (when \code{compound_taskid_set} is
provided).
}
\description{
Transform sample model output into a forecast object
}
\examples{
\dontshow{if (requireNamespace("hubExamples", quietly = TRUE)) withAutoprint(\{ # examplesIf}
# Marginal sample forecast: each modeling task scored independently
sample_forecast <- hubExamples::forecast_outputs |>
  dplyr::filter(.data[["output_type"]] == "sample") |>
  transform_sample_model_out(
    oracle_output = hubExamples::forecast_oracle_output
  )
sample_forecast

# Compound sample forecast: jointly score across non-compound task IDs
compound_forecast <- hubExamples::forecast_outputs |>
  dplyr::filter(.data[["output_type"]] == "sample") |>
  transform_sample_model_out(
    oracle_output = hubExamples::forecast_oracle_output,
    compound_taskid_set = c("reference_date", "location")
  )
compound_forecast
\dontshow{\}) # examplesIf}
}
