| process_y_functional | R Documentation |
Preprocesses outcome data (y) into a format suitable for Keras models
built with the Functional API. Handles both regression (numeric) and
classification (factor) outcomes, including one-hot encoding for
classification, and supports multiple outputs.
process_y_functional(
y,
is_classification = NULL,
class_levels = NULL,
layer_blocks = NULL
)
y |
A vector or data frame of outcomes. |
is_classification |
Logical, optional. If |
class_levels |
Character vector, optional. The factor levels for
classification outcomes. If |
layer_blocks |
A named list of layer block functions, optional. Used
to disambiguate a multi-column |
A list containing:
y_proc: The processed outcome data (matrix or one-hot encoded array,
or list of these for multiple outputs).
is_classification: Logical, indicating if y was treated as
classification.
num_classes: Integer, the number of classes for classification, or
NULL.
class_levels: Character vector, the factor levels for classification,
or NULL.
multistep_info: For the single vector-valued output case only, a
list with steps (integer vector) and vars (character vector)
describing the structure of the outcome's columns. NULL otherwise.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.