r descr_models("naive_Bayes", "naivebayes")

Tuning Parameters

defaults <- 
  tibble::tibble(parsnip = c("smoothness", "Laplace"),
                 default = c("1.0", "0.0"))

param <-
  naive_Bayes() %>% 
  set_engine("naivebayes") %>% 
  make_parameter_list(defaults)

This model has r nrow(param) tuning parameter:

param$item

Note that the engine argument usekernel is set to TRUE by default when using the naivebayes engine.

Translation from parsnip to the original package

r uses_extension("naive_Bayes", "naivebayes", "classification")

library(discrim)

naive_Bayes(smoothness = numeric(0), Laplace = numeric(0)) %>% 
  set_engine("naivebayes") %>% 
  translate()

Preprocessing requirements

The columns for qualitative predictors should always be represented as factors (as opposed to dummy/indicator variables). When the predictors are factors, the underlying code treats them as multinomial data and appropriately computes their conditional distributions.

For count data, integers can be estimated using a Poisson distribution if the argument usepoisson = TRUE is passed as an engine argument.


Case weights


References



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on Aug. 18, 2023, 1:07 a.m.