nb: Naive Bayes using e1071::naiveBayes

View source: R/nb.R

nbR Documentation

Naive Bayes using e1071::naiveBayes

Description

Naive Bayes using e1071::naiveBayes

Usage

nb(
  dataset,
  rvar,
  evar,
  laplace = 0,
  data_filter = "",
  arr = "",
  rows = NULL,
  envir = parent.frame()
)

Arguments

dataset

Dataset

rvar

The response variable in the logit (probit) model

evar

Explanatory variables in the model

laplace

Positive double controlling Laplace smoothing. The default (0) disables Laplace smoothing.

data_filter

Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")

arr

Expression to arrange (sort) the data on (e.g., "color, desc(price)")

rows

Rows to select from the specified dataset

envir

Environment to extract data from

Details

See https://radiant-rstats.github.io/docs/model/nb.html for an example in Radiant

Value

A list with all variables defined in nb as an object of class nb

See Also

summary.nb to summarize results

plot.nb to plot results

predict.nb for prediction

Examples

nb(titanic, "survived", c("pclass", "sex", "age")) %>% summary()
nb(titanic, "survived", c("pclass", "sex", "age")) %>% str()


radiant-rstats/radiant.model documentation built on Nov. 29, 2023, 5:59 a.m.