Skip to contents

Predicts new data using a BayesClassifier object

Usage

# S3 method for BayesClassifier
predict(object, newdata, type = "probs", ...)

Arguments

object

a BayesClassifier object

newdata

a data.frame containing new features to predict

type

type of return value, either "probs", or "class"

...

currently unused

Value

either a matrix containing log-probabilities, or a vector of classes, see ´details´.

Details

Given a BayesClassifier object and a data.frame of new data, predictions are computed for each data point. Two types of predictions are available:

  • ´probs´: returns the matrix of log-class probabilities for each sample and class

  • ´class´: returns the vector of class labels with the highest predictive probabilities for each sample