The infix operators %class% and %prob% are shorthands for performing classification and obtaining posterior probabilities, respectively.
lhs %class% rhs
lhs %prob% rhs
Arguments
lhs: object of class inheriting from "naive_bayes" and "*_naive_bayes" family.
rhs: dataframe or matrix for "naive_bayes" objects OR matrix for all "*_naive_bayes" objects.
Returns
%class% returns factor with class labels corresponding to the maximal conditional posterior probabilities.
%prob% returns a matrix with class label specific conditional posterior probabilities.
Details
If lhs is of class inheriting from the family of the Naive Bayes objects and rhs is either dataframe or matrix then the infix operators %class% and %prob% are equivalent to: