Description Usage Arguments Details Value Author(s) See Also Examples
The infix operators %class%
and %prob%
are shorthands for performing classification and obtaining posterior probabilities, respectively.
1 2 | lhs %class% rhs
lhs %prob% rhs
|
lhs |
object of class inheriting from |
rhs |
dataframe or matrix for "naive_bayes" objects OR matrix for all "*_naive_bayes" objects. |
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:
lhs %class% rhs
<=> predict(lhs, newdata = rhs, type = "class", threshold = 0.001, eps = 0)
lhs %prob% rhs
<=> predict(lhs, newdata = rhs, type == "prob", threshold = 0.001, eps = 0)
Compared to predict()
, both operators do not allow changing values of fine tuning parameters threshold
and eps
.
%class%
returns factor with class labels corresponding to the maximal conditional posterior probabilities.
%prob%
returns a matrix with class label specific conditional posterior probabilities.
Michal Majka, michalmajka@hotmail.com
predict.naive_bayes
, predict.bernoulli_naive_bayes
, predict.multinomial_naive_bayes
, predict.poisson_naive_bayes
, predict.gaussian_naive_bayes
, predict.nonparametric_naive_bayes
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.