Learn R Programming

butcher (version 0.3.5)

axe-multnet: Axing an multnet.

Description

multnet objects are created from carrying out multinomial regression in the glmnet package.

Usage

# S3 method for multnet
axe_call(x, verbose = FALSE, ...)

Value

Axed multnet object.

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.

Examples

Run this code
if (FALSE) { # rlang::is_installed("glmnet")
# Load libraries
library(parsnip)

# Load data
set.seed(1234)
predictrs <- matrix(rnorm(100*20), ncol = 20)
colnames(predictrs) <- paste0("a", seq_len(ncol(predictrs)))
response <- as.factor(sample(1:4, 100, replace = TRUE))

# Create model and fit
multnet_fit <- multinom_reg(penalty = 0.1) %>%
  set_engine("glmnet") %>%
  fit_xy(x = predictrs, y = response)

out <- butcher(multnet_fit, verbose = TRUE)
}

Run the code above in your browser using DataLab