apd_hat_values: Fit a 'apd_hat_values'

View source: R/hat_values-fit.R

apd_hat_valuesR Documentation

Fit a apd_hat_values

Description

apd_hat_values() fits a model.

Usage

apd_hat_values(x, ...)

## Default S3 method:
apd_hat_values(x, ...)

## S3 method for class 'data.frame'
apd_hat_values(x, ...)

## S3 method for class 'matrix'
apd_hat_values(x, ...)

## S3 method for class 'formula'
apd_hat_values(formula, data, ...)

## S3 method for class 'recipe'
apd_hat_values(x, data, ...)

Arguments

x

Depending on the context:

  • A data frame of predictors.

  • A matrix of predictors.

  • A recipe specifying a set of preprocessing steps created from recipes::recipe().

...

Not currently used, but required for extensibility.

formula

A formula specifying the predictor terms on the right-hand side. No outcome should be specified.

data

When a recipe or formula is used, data is specified as:

  • A data frame containing the predictors.

Value

A apd_hat_values object.

Examples

predictors <- mtcars[, -1]

# Data frame interface
mod <- apd_hat_values(predictors)

# Formula interface
mod2 <- apd_hat_values(mpg ~ ., mtcars)

# Recipes interface
library(recipes)
rec <- recipe(mpg ~ ., mtcars)
rec <- step_log(rec, disp)
mod3 <- apd_hat_values(rec, mtcars)

tidymodels/applicable documentation built on March 18, 2023, 4:08 p.m.