% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/naive_bayes.R
\name{fit_naive_bayes}
\alias{fit_naive_bayes}
\title{Fit a multinomial Naive Bayes text classifier}
\usage{
fit_naive_bayes(x, y, laplace = 1, prior = NULL)
}
\arguments{
\item{x}{Nonnegative numeric document-term matrix.}

\item{y}{Class labels with one value per row of \code{x}.}

\item{laplace}{Nonnegative additive smoothing parameter.}

\item{prior}{Optional named class probabilities.}
}
\value{
An object of class \code{text_nb}.
}
\description{
Fit a multinomial Naive Bayes text classifier
}
\examples{
x <- rbind(c(3, 0), c(2, 0), c(0, 3), c(0, 2))
colnames(x) <- c("analysis", "care")
model <- fit_naive_bayes(x, c("data", "data", "health", "health"))
predict(model, x)
}
