dot-get_prediction_column_names: Obtain names of prediction columns for a fitted model or...

.get_prediction_column_namesR Documentation

Obtain names of prediction columns for a fitted model or workflow

Description

.get_prediction_column_names() returns a list that has the names of the columns for the primary prediction types for a model.

Usage

.get_prediction_column_names(x, syms = FALSE)

Arguments

x

A fitted parsnip model (class "model_fit") or a fitted workflow.

syms

Should the column names be converted to symbols? Defaults to FALSE.

Value

A list with elements "estimate" and "probabilities".

Examples


library(dplyr)
library(modeldata)
data("two_class_dat")

levels(two_class_dat$Class)
lr_fit <- logistic_reg() %>% fit(Class ~ ., data = two_class_dat)

.get_prediction_column_names(lr_fit)
.get_prediction_column_names(lr_fit, syms = TRUE)


parsnip documentation built on April 4, 2025, 1:53 a.m.