axe-mass: Axing a MASS discriminant analysis object.

axe-massR Documentation

Axing a MASS discriminant analysis object.

Description

lda and qda objects are created from the MASS package, leveraged to carry out linear discriminant analysis and quadratic discriminant analysis, respectively.

Usage

## S3 method for class 'lda'
axe_env(x, verbose = FALSE, ...)

## S3 method for class 'qda'
axe_env(x, verbose = FALSE, ...)

Arguments

x

A model object.

verbose

Print information each time an axe method is executed. Notes how much memory is released and what functions are disabled. Default is FALSE.

...

Any additional arguments related to axing.

Value

Axed lda or qda object.

Examples


library(MASS)

fit_da <- function(fit_fn) {
  boop <- runif(1e6)
  fit_fn(y ~ x, data.frame(y = rep(letters[1:4], 10000), x = rnorm(40000)))
}

lda_fit <- fit_da(lda)
qda_fit <- fit_da(qda)

lda_fit_b <- butcher(lda_fit)
qda_fit_b <- butcher(qda_fit)

weigh(lda_fit)
weigh(lda_fit_b)

weigh(qda_fit)
weigh(qda_fit_b)


tidymodels/butcher documentation built on April 15, 2024, 9:18 p.m.