pmml.naiveBayes {pmml} | R Documentation |
Generate the PMML representation for a naiveBayes object from package e1071.
## S3 method for class 'naiveBayes' pmml(model, model.name="naiveBayes_Model", app.name="Rattle/PMML", description="NaiveBayes Model", copyright=NULL, transforms=NULL, unknownValue=NULL, predictedField, ...)
model |
a |
model.name |
a name to be given to the model in the PMML code. |
app.name |
the name of the application that generated the PMML code. |
description |
a descriptive text for the Header element of the PMML code. |
copyright |
the copyright notice for the model. |
transforms |
data transformations represented in PMML via package pmmlTransformations. |
unknownValue |
value to be used as the 'missingValueReplacement' attribute for all MiningFields. |
predictedField |
Required parameter; the name of the predicted field. |
... |
further arguments passed to or from other methods. |
The PMML representation of the NaiveBayes model implements the definition as specified by the Data Mining Group: intermediate probability values which are less than the threshold value are replaced by the threshold value. This is different from the prediction function of the e1071 in which only probability values of 0 and standard deviations of continuous variables of with the value 0 are replaced by the threshold value. The two values will therefore not match exactly for cases involving very small probabilities.
Zementis Inc. info@zementis.com
R project CRAN package:
e1071: Misc Functions of the Department of Statistics (e1071), TU Wien
http://cran.r-project.org/web/packages/e1071/index.html
A. Guazzelli, T. Jena, W. Lin, M. Zeller (2013). Extending the Naive Bayes Model Element in PMML: Adding Support for Continuous Input Variables. In Proceedings of the 19th ACM SIGKDD Conference on Knowledge Discovery and Data Mining.
# Build a simple Naive Bayes model # Upload the required library library(e1071) library(pmml) library(mlbench) # download an example dataset data(HouseVotes84) house <- na.omit(HouseVotes84) # Construct an example model defining a threshold value of 0.003 model<-naiveBayes(Class~V1+V2+V3,data=house,threshold=0.003) # Output the PMML representation pmml(model,dataset=house,predictedField="Class") rm(model)