"pmml"(model, model.name="AdaBoost_Model", app.name="R-PMML", description="AdaBoost Model", copyright=NULL, transforms=NULL, unknownValue=NULL, ...)
ada
object. The pmml
function exports the ada model in the PMML MiningModel (multiple models) format.
The MiningModel element consists of a list of TreeModel elements, one in each model segment.
This function implements the discrete adaboost algorithm only.
Note that each segment tree is a classification model, returning either -1 or 1.
However the MiningModel (ada algorithm) is doing a weighted sum of the returned value, -1 or 1.
So the value of attribute functionName of element MiningModel is set to "regression";
the value of attribute functionName of each
segment tree is also set to "regression" (they have to be the same as the parent MiningModel
per PMML schema). Although each segment/tree is being named a "regression" tree,
the actual returned score can only be -1 or 1, which practically turns each segment
into a classification tree.
The model in PMML format has 5 different outputs. The "rawValue" output is the value of the model
expressed as a tree model. The boosted tree model uses a transformation of this value, this is the
"boostValue" output. The last 3 outputs are the predicted class and the probabilities of each of the
2 classes (The ada package Boosted Tree models can only handle binary classification models).
library(ada)
library(pmml)
data(audit)
fit <- ada(Adjusted~Employment+Education+Hours+Income,iter=3, audit)
pmml_fit <- pmml(fit)
Run the code above in your browser using DataCamp Workspace