predict.NBAYES: Prediction method for NBC

Description Usage Arguments Value Examples

View source: R/predict.R

Description

Compute posterior probabilities and class based on Naive Bayes Classifier

Usage

1
predict.NBAYES(object_NBAYES, data_test, type="both", parallel=FALSE)

Arguments

object_NBAYES

an object of class NBAYES build using fit

data_test

a dataframe containing the variables to predict

type

a character type, it will define what the function will return. Can be "posterior", if the user want to get only the posterior probabilities for the different predict class. "class" which give the user only the modality of the prediction. And "both" that will return both "posterior" and "class" informations.

parallel

a logic that allow the user to compute the function using parallel computation.

Value

a dataframe containing the posterior probabilities, the predict class or both of them.

Examples

1
2
3
4
5
data(iris)
train <- iris
test <- iris[-5]
model <- fit(Species ~ ., train, laplace=1, parallel=FALSE)
res <- predict(model, test, type="class")

ldelecourt/NBC_package documentation built on Dec. 16, 2019, 10:51 p.m.