PMML 1.1 -- General Regression
Model DTD and Tag Description
Note: the model below assumes that dictionary tags are defined elsewhere.
Variables are referred to by name.
|
|
|
GeneralRegressionModel
: marks the beginning of a general
regression model. As the name says it, this is intended to support a
multitude of regression models.
ParameterList : lists all Parameters. Each Parameter contains a required name, and optional label. Parameter names should be unique within the model and as brief as possible(since Parameter names appear frequently in the document). The label, if present, is meant to give a hint on Parameter's correlation with the Predictors. FactorList : list of factor names. Not present if this particular regression flavor does not support factors (ex. linear regression). If present, the list may or may not be empty. Each name in the list must match a name from the dictionary. The factors are assumed to be categorical variables. CovariateList : list of covariate names. Will not be present when there is no covariate. Each name in the list must match a name from the dictionary. The covariates will be assumed as continuous variables. targetVariableName : name of the target variable (also called response variable). must match a name from the dictionary. modelType : specifies the type of regression model in use. this information will be used to select the appropriate mathematical formulas during scoring. The supported regression algorithms are listed.
modelName
: This is a unique identifier specifying the name of the regression model.
PPMatrix : Predictor-to-Parameter correlation matrix. It is a rectangular matrix having a column for each Predictor (factor or covariate) and a row for each Parameter. The matrix is represented as a sequence of cells, each cell containing a number representing the correlation between the Predictor and the Parameter. The cell values are computed as follows: ~ For each Predictor variable v and each Parameter p, the corresponding cell value is missing (empty) if there is no correlation between v and p .The empty cells are not required to be present in the exported model file. All cells determined to be missing from the xml file at model parsing will be assumed to be empty. Since empty cells make up a large chunk of the matrix, this will reduce the size of the exported model. Note the IMPLIED targetCategory attribute. This is permitted in order to allow usage of different pp-matrices for different response values. If any PPCell contains this attribute, the expectation is that for that particular response level, a full PPMatrix can be reconstructed from the PMML document. It is that matrix which will be used during scoring in order to get the probability (and other stats) for the response level. By default, all target categories share the PPMatrix. targetCategory attribute can thus be used to override the default for some or all target categories.
PPCell
: cell in the PPMatrix. knows its row name, column name, and information as
described above.
PCovMatrix : matrix of Parameter estimate covariances. made up of PCovCells, each of them being located via row information for Parameter name (pRow), row information for target variable value (tRow), column information for Parameter name (pCol) and column information for target variable value (tCol). Note that the matrix is symmetric with respect to the main diagonal (interchanging tRow and tCol will not change the value, same for the pair pRow and pCol). Therefore it is sufficient that only half of the matrix is exported. ParamMatrix : Parameter matrix. A table containing the Parameter values along with associated statistics (degrees of freedom). One dimension has the target variable's categories, the other has the Parameter names. The table is represented by specifying each cell. There is no requirement for Parameter names other than that each name should uniquely identify one Parameter. PCell : cell in the ParamMatrix. The targetCategory and parameterName attributes determine the cell's location in the Parameter matrix. The information contained is : beta (actual Parameter value, required), and df (degrees of freedom, optional).
General Regression SampleHere is the information about the variables: |
Name Type Number of Categories (numeric coding in parentheses)
categories
JOBCAT Target 7 Clerical(1), Office trainee(2), Security officer(3),
College trainee(4), Exempt employee(5),
MBA trainee(6), and Technical(7)
SEX Factor 2 Males(0), and Females(1)
MINORITY Factor 2 White(0), and Nonwhite(1)
AGE Covariate
WORK Covariate
|
|
The Parameter estimates are displayed as follows: The PPMatrix is:
|
|
|
This Predictor-to-Parameter combinations mapping is the same for each target
variable category.
The corresponding XML model is : |
|
|
Scoring AlgorithmWe will use the above example to illustrate the steps that should be followed in the scoring process. Say the following case (observation) must be scored:
obs = (sex=1 minority=0 age=25 work=4)
|
|
|