| build_ancestor_matrix_from_outcomes | R Documentation |
Extracts class names from the outcome tibble (factor levels) and builds the ancestor matrix only for classes that actually appear in the data.
build_ancestor_matrix_from_outcomes(x, outcomes, device = "cpu")
x |
A |
outcomes |
A tibble with factor columns (one per hierarchy level),
as returned by |
device |
Torch device ("cpu" or "cuda"). |
A torch_tensor of shape (1, n_classes, n_classes).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.