50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


butcher (version 0.3.5)

axe-NaiveBayes: Axing a NaiveBayes.

Description

NaiveBayes objects are created from the klaR package, leveraged to fit a Naive Bayes Classifier.

Usage

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

# S3 method for NaiveBayes axe_data(x, verbose = FALSE, ...)

Value

Axed NaiveBayes 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("klaR")
library(klaR)

fit_mod <- function() {
  boop <- runif(1e6)
  NaiveBayes(
    y ~ x,
    data = data.frame(y = as.factor(rep(letters[1:4], 1e4)), x = rnorm(4e4))
  )
}

mod_fit <- fit_mod()
mod_res <- butcher(mod_fit)

weigh(mod_fit)
weigh(mod_res)

}

Run the code above in your browser using DataLab