Learn R Programming

scoringutils (version 2.3.0)

ensure_sample_matrix: Ensure that predicted samples are a matrix

Description

Converts a vector of predictive samples (allowed as input when there is only a single observation) into a 1xN matrix so that downstream row-wise operations work as expected. Matrix input is returned unchanged.

Usage

ensure_sample_matrix(predicted)

Value

An nxN matrix of predictive samples.

Arguments

predicted

A vector of size N (predictive samples for a single observation) or an nxN matrix of predictive samples.