pfa.naiveBayes {aurelius} | R Documentation |
This function takes a Naive Bayes model fit using naiveBayes() and returns a list-of-lists representing in valid PFA document that could be used for scoring
## S3 method for class 'naiveBayes' pfa(object, name = NULL, version = NULL, doc = NULL, metadata = NULL, randseed = NULL, options = NULL, threshold = 0.001, eps = 0, pred_type = c("response", "prob"), cutoffs = NULL, ...)
object |
an object of class "naiveBayes" |
name |
a character which is an optional name for the scoring engine |
version |
an integer which is sequential version number for the model |
doc |
a character which is documentation string for archival purposes |
metadata |
a |
randseed |
a integer which is a global seed used to generate all random numbers. Multiple scoring engines derived from the same PFA file have different seeds generated from the global one |
options |
a |
threshold |
a value replacing cells with probabilities within eps range. |
eps |
a numeric for specifying an epsilon-range to apply laplace smoothing (to replace zero or close-zero probabilities by theshold.) |
pred_type |
a string with value "response" for returning the predicted class or the value "prob", which for returns the predicted probability of each class. |
cutoffs |
A named numeric vector of length equal to number of classes. The "winning" class for an observation is the one with the maximum ratio of predicted probability to its cutoff. The default cutoffs assume the same cutoff for each class that is 1/k where k is the number of classes |
... |
additional arguments affecting the PFA produced |
a list
of lists that compose valid PFA document
pfa_config.R avro_typemap.R avro.R pfa_cellpool.R pfa_expr.R pfa_utils.R
model <- e1071::naiveBayes(Species ~ ., data=iris) model_as_pfa <- pfa(model)