Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification and tests for a new linear regression model export spec #78

Open
wants to merge 4 commits into
base: linear-regression-export
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2021-08-05T18:29:28.460Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" etag="ZKLFbWCQEUq2j-GrEsyn" version="14.9.4" type="device"><diagram id="D6tS7kNY8i6PEjJ5m5Gs" name="Page-1">7Zpbc6IwFMc/jY+7w03Ux9a17c62M059aF8jHCG7IbEheNlPvwGCiFpA7VboONPphMMhl3Pyy1+OdsxhsLrnaO4/MRdIx9DcVcf80TEM3TKMTvynuevU0rOVwePYVU65YYL/gjJqyhphF8KCo2CMCDwvGh1GKTiiYEOcs2XRbcZIcdQ58mDPMHEQ2be+YFf4qbVv9HL7A2DPz0bW7UF6J0CZs1pJ6COXLbdM5qhjDjljIm0FqyGQOHhZXNLn7t65u5kYByrqPDAYmC/ryevDmIS/fr6+Pc/Ct/W3btrLApFILVhNVqyzCIArA6IuGRc+8xhFZJRbbzmLqAvxMJq8yn0eGZtLoy6Nv0GItcouigSTJl8ERN3dX4paXcgi7kDJ/G21JRD3QJT49VO/eC1bA6hA3QMLQPC1dOBAkMCLYvKR2kPexi8Ps2yoSB8RdXsv6jeuGw/UiXNoE7mS26lseHFjjDiSwwJ/xKHYcpAjb3yo5C4hI/7nw6Fu7oECR+QZPA5hiBnNWH2/v52NkKc5ztnSxwImc5SkZynhL6YUTUNGIgE33FFpT6z5lSUvQ8HZnw1XRtlOWAAXsCrNnbprGlb6iDpxuoq/ZY6v3lc2fxtdTftP6e61HLJ+TciyM7shlPVLKKNRMAUuG2xWylwJH2EFcEdwC28RIsXuihNcII7RlCRjYpo44bg9w3JvGMM4rySKDYxConJ80xGmcgoOzEVrebaM790C0ZsPB9tIW+ZnIj1oOdJZBKuZNhrFdDbvetJ5hxzBrrp5mm6avYsLp67vZbtlmBl1MbOahZlRVzttFMQ7mE7DeRKpXRHk4OIYwjOEtC7FlSrqIAEe49hJ3A5oKmwkdXdZXwPprjG4ONJm25G26iJtNwtp6xjlHLIEDwFX8axJWvEjqj04IJ693qeS1vbajl63uKM3q7qjl5V3ql48P0Avj2C3WjIZFZhGLHm5LFXMtnJbVMj+5atFetvLRXrdelFWGW8Kt2UFo31Sx09IcLy6iuPRkOmabmYlnQty1vYaToZPNWfNquFk8z5JH8dqhJOrsrWwPbMg+0Uw1S9fATLaXgHK5lsNabMqQNm8j/iO8qqHp4JmmpcHraw8UHUon3smb++e/S52q3FnnNH560rd78w02Qq+zEazDpUlPmqjycv81yzJva3fBJmjfw==</diagram></mxfile>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile host="app.diagrams.net" modified="2021-02-26T17:20:42.428Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36" etag="CgwObZRihwNpEhiK9Vah" version="14.4.3" type="device"><diagram id="DeD2rW5w_rSIAgtTgJ-d" name="Page-1">7VzbcqM4EP0aPyZlrrYfE+cyWzXZ8kxma2eetmSQQTuAvELE9nz9SlzMRRgrY+KgJFWpFDQCpJZOn+5W45ExD7f3BKz9B+zCYKSP3e3IuBnpumbq+oj/jd1dJpnYucAjyM0blYJH9AvmwnEuTZAL41pDinFA0boudHAUQYfWZIAQvKk3W+Gg/tY18KAgeHRAIEr/Ri71M+lUn5TyTxB5fvFmzZ5lV0JQNM5HEvvAxZuKyLgdGXOCMc2Owu0cBlx5hV6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="app.diagrams.net" modified="2021-08-05T18:31:24.480Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" etag="5khhRAMkBOMQrqi1YZSr" version="14.9.4" type="device"><diagram id="DeD2rW5w_rSIAgtTgJ-d" name="Page-1">5Vtbc5s4FP41fkzGgLHxY67uzjS7adPuNk8dGY5BG4G8QsR2f/1KIK7ClyaObZKZTAYOAqTvnO/chHvWVbicMDQP7qgHpGf2vWXPuu6ZpjEwzZ7863urTDIaKoHPsKcGlYIH/AuUsK+kCfYgrg3klBKO53WhS6MIXF6TIcbooj5sRkn9rXPkgyZ4cBHRpf9gjweZ1DFHpfwTYD/I32wMx9mVEOWD1UriAHl0URFZNz3rilHKs6NweQVEgpfjkt13u+ZqMTEGEd/lhqlz/5R8/3IffRncIvw8+coe7bN8cs+IJGrFarZ8lUMAnkBEnVLGA+rTCJGbUnrJaBJ5IN/TF2flmM+UzoXQEMJ/gfOVUi9KOBWigIdEXdXXopYX04S5sGEBuU0g5gPftNBsnFxL5QUKqQnQEDhbiQEMCOL4ua59pIzIL8aVOIsDBfVvwG5oqF+CjyMN+pgz+lQYnlkHTRjUXI4Ll77k3vmM0IUbIMbPYwEH/ymHLwLM4WGOUgwXYtgmsJ+BcVhuhEddtYaD7BbFaluZ0aKkiNFXsqBKj1y4d0QHTscN2dzRkAejk7JkU4P9wvPki3rStQyJWMrlVBz48mACETBEvoLPII4xjfJ4kY8UUygGR+Ja6u3lv0Ae/rj7LCMJdZNQwttUb6k8Y43lVxSFpjElCYcL5iplptLybCAZptFvH9wx6twpQl2FPOZhyWPqWuwWeawdyZNDf3jy3CQk6f9tTrg5ufg55c5f49hpCQPHg70ByRvrwTqmz7I02P+ICyczwwS+rebQ5r+mwNGZS2E2wy4W4IiJ3ba5rn3FcQ9cLN3kGwbyhjMajo/ujCz7GCQQELLVj+rJo3zYuZ2fXi/Vw7OzVfXsHhgWiwemhC8nkLEzg5x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Wd4X7cgTgtf+aV9fjKH8tZN/8D</diagram></mxfile>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2021-08-05T18:34:27.811Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" etag="iWdWEKVqN3bH4a6UbLQ1" version="14.9.4" type="device"><diagram id="XmuBe62zo_47xGJrIFbV" name="Page-1">1VhtU+IwEP41fMSBthT8qIico84ozM35zQnt0gbTpJdueblff0lJaWuBwTtUmHEwebJtNs/usxto2P1oOZQkDh+FD6xhtfxlw75pWFbbsayG/mv5qzXSdQ0QSOobowIY0z9gwJZBU+pDUjFEIRjSuAp6gnPwsIIRKcWiajYVrLprTAKoAWOPsDr6i/oYrtGe1S3wH0CDMN+57V6uVyKSG5uTJCHxxaIE2YOG3ZdC4HoULfvANHk5L+vnbnesbhyTwPGQB0aj2/Go+3xFXu8v/c79cHYTOk3zljlhqTmwcRZXOQPgK0LMVEgMRSA4YYMCvZYi5T7obVpqVtg8CBErsK3AGSCuTHRJikJBIUbMrNaPYvxKRCo92OO/cReJDAD32DlrO32W0gaGqCGICFCulIEERpDOq8EnJoeCjV1BsxoYpj/AulVj/RoCymvUJyjF2ybvrCppKp9ibRctAy29iykTCy8kEi8SRQe+avNFSBHGMck4XCizfWTPQSIs99JjVm3X8GlE3TEpvigU0m4ZLCyrIwePzqh95nnsHJrHvZNKZKdG+5Xv640auhi5TB3leqIGgR4MgYMkbASBhCShgufdIrdULmyMuVrLar3+CPXw5fFB9xHhpZGm9314i+C1dyR+KVBkkgiWIlxJzwQzQ4uZowVWU98xpNOuSmfT6Erasb5WO06rFsUB11F8IjKhPFCjB8qBSDUogqcmY4T4WDULQUaUExTy68pW79C65X4a9d1zr1u9AwtXTvWpFK7eRyrXI+VKB2MvhKi8vqVeLSiGupGbmvX/NfDiXAud1a2Kze5uKXS9zyp0/Tv7jj29vtmz2Rs4z/Nlx3lpuicktnc6+Df15aIqq2/ryTvfqbVOvb8UWuNpNAHdWcR0t/JuKTB/j0gSTejvlLDqjaH67uxWnLkhKZmw7KGSVHNY3zEACWVJ9p0NFK9WX8eHpRoRHLKvkXLzYCzBpx6CdlCk6CnWtIUU0cYk0iI/YyW3K0ru2J0tSna/Usmn1DY/quTdAj3k/t/aHqqjK3mflyXaf8Y+QThiv1NLqbl0rl85UWJsegKmU+pRxWvSnNJMpfruqP5l18dvlFZNR1sS4GBpuZfbmuSRpKWmxa9N2VrpNzt78Bc=</diagram></mxfile>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/specs/model-csv-to-pmml/images/fine-and-gray-step.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 112 additions & 13 deletions assets/specs/model-csv-to-pmml/model-csv-to-pmml-spec.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,29 @@ model_steps_file_metadata <- data.frame(
center; <br/>
interaction; <br/>
rcs; <br/>
fine-and-gray <br/>",
fine-and-gray; <br/>
linear-regression;",

"beta-coefficients; <br/>
baseline-hazards; <br/>",

"N/A",

"N/A"
),
enumLabels = c(
"Create dummy variables; <br/>
Center a set of variables; <br/>
Create interaction terms; <br/>
Create restricted cubic spline terms; <br/>
Calculate the outcome of a fine and gray model <br/>",
Calculate the outcome of a fine and gray model; <br/>
Calculate the outcome of a linear regression model; <br />",

"Used to specify the beta coefficients file for a fine and gray step; <br/>
Used to specify the baseline hazards file for a fine and gray step",
Used to specify the baseline hazards file for a fine and gray step; <br />",

"N/A",

"N/A"
),
restrictions = c("mandatory", "", "mandatory", "")
Expand Down Expand Up @@ -382,16 +390,7 @@ DT::datatable(eg_interaction_step)

The example above creates two new interaction variables, `AgeXCancer` and `AgeXHypertension`. `AgeXCancer` is created using the `Age` and `Cancer` variables while `AgeXHypertension` is created using the `Age` and `Hypertension` variables. Both new interaction variables are continuous. Notice how the interacting variables are seperated by a semi-colon in the example.

## Fine and Gray Model Step Files

Similar to a cox regression model, a fine and gray model estimates the risk of an event occuring at some time in the future, the difference being that it takes competing risks into account. Specifying this step requires two files,

1. A beta coefficients file which specifies the names of the covariates in the model and their beta coefficient
2. A baseline hazards file which specifies a time value and the baseline hazard value associated with it

The metadata for the beta coefficients file is given below:

```{r echo=FALSE}
```{r}
beta_coefficients_step_file_metadata <- data.frame(
fileType = c("beta coefficients step", "beta coefficients step", "beta coefficients step"),
columnName = c("variable", "coefficient", "type"),
Expand Down Expand Up @@ -420,7 +419,18 @@ beta_coefficients_step_file_metadata <- data.frame(
"mandatory"
)
)
```

## Fine and Gray Model Step Files

Similar to a cox regression model, a fine and gray model estimates the risk of an event occuring at some time in the future, the difference being that it takes competing risks into account. Specifying this step requires two files,

1. A beta coefficients file which specifies the names of the covariates in the model and their beta coefficient
2. A baseline hazards file which specifies a time value and the baseline hazard value associated with it

The metadata for the beta coefficients file is given below:

```{r echo=FALSE}
DT::datatable(beta_coefficients_step_file_metadata, escape = FALSE)
```

Expand Down Expand Up @@ -504,6 +514,35 @@ The beta coefficients file says that the model has two covariates, `Age` and `Se

The baseline hazards has 5 rows and describes the baseline hazards for each year in the model. Notice how the lowest time value is `1` and the highest value is `5`. This is because of the time variable we specified earlier which goes from 1 to 5.

## Linear Regression Model

A linear regression model is used to predict a continuous outcome from a set of covariates. Adding this step requires a beta coefficients file which specifies the names of the covariates in the model and their beta coefficient value. The metadata for the beta coefficients file is given below:

```{r echo=FALSE}
DT::datatable(beta_coefficients_step_file_metadata, escape = FALSE)
```

An example model steps file with a linear regression step are shown below are shown below.

```{r echo=FALSE}
eg_linear_regression_model_steps_file <- data.frame(
"step" = c("linear-regression"),
"fileType" = c("N/A"),
"filePath" = c("beta-coefficients.csv")
)
DT::datatable(eg_linear_regression_model_steps_file)

eg_beta_coefficients_csv <- data.frame(
"variable" = c("Age", "Sex"),
"coefficient" = c(0.01, 2)
)
DT::datatable(eg_beta_coefficients_csv)
```

The model steps file has a single row for a step to calculate the outcome of a linear regression model. Since this step requires only one file to fully specify it, we can enter in a value of `N/A` in the `fileType` column. The `filePath` column has the path to the file with the covariates and the beta coefficients for the model. Once again the paths should be relative to the model steps file that described them.

The beta coefficients file says that the model has two covariates, `Age` and `Sex` and specifies the beta coefficients for each one which are `0.01` and `2` respectively.

# Business Logic

This section will go through the logic for transforming a set of model CSV files into PMML. The flowchart below broadly outlines the steps. The next few section will go through each step in the flow chart in detail.
Expand Down Expand Up @@ -894,6 +933,66 @@ For the example CSV file used to introduce this step, the converted PMML file wo
</GeneralRegressionModel>
```

### Linear Regression Step

This involves converting the beta coefficients file into the XML nodes to add to the document. The steps for this part are:

![](./images/linear-regression-step.png)
Things to note:

1. The following attributes need to be added to the `GeneralRegressionModel`
* `modeType` set to `generalLinear`
* `functionName` set to `regression`
2. The following attributes need to be set for each `MiningField` nodes
* `name`: Set to the name of the starting variable. For the extra node added for the predicted outcome, the value would be `linear_regression_outcome`.
* `usageType`: Set to `active`. For the extra node added for the predicted outcome, the value would be `target`.
3. The following attributes need to be set to the `Parameter` node
* `name` set to `p<index>` where index is the row number of the variable in the file. For the extra node added for the intercept, this value would be `p0`
* `label` set to the value of the variable column. For the extra node added for the intercept, this value would be `Intercept`
4. The following attributes need to be set for each `Predictor` node
* `name` set to the value of the variable column
5. The following attributes need to be set for each `PPCell` node
* `value` set to `1`
* `predictorName` set to the value in the variable column
* `parameterName` set to the value of the name attribute for the Parameter node for this variable
6. The following attributes need to be set for each `PCell` node
* `parameterName`: Set to the name attribute of the Parameter node for this variable. Remember that for the intercept term, this would be `p0`
* `beta`: Set to the value of the coefficient column

For the example CSV file used to introduce this step, the converted PMML file would be,

```{xml}
<GeneralRegressionModel
modelType="generalLinear"
functionName="regression">
<MiningSchema>
<MiningField name="linear_regression_outcome" usageType="target" />
<!-- Add additional MinineField nodes equal to the starting variables for
the selected database in variable details-->
</MiningSchema>
<ParameterList>
<Paramater name="p0" label="Intercept" />
<Parameter name="p1" label="Age" />
<Parameter name="p2" label="Sex" />
</ParameterList>
<FactorList>
<Predictor name="Sex" />
</FactorList>
<CovariateList>
<Predictor name="Age" />
</CovariateList>
<PPMatrix>
<PPCell value="1" predictorName="Sex" parameterName="p1" />
<PPCell value="1" predictorName="Age" parameterName="p2" />
</PPMatrix>
<ParamMatrix>
<PCell parameterName="p0" beta="0" />
<PCell parameterName="p1" beta="0.01" />
<PCell parameterName="p2" beta="2" />
</ParamMatrix>
</GeneralRegressionModel>
```

# Implementation

The skeleton for the exported function to implement the above business logic is given below,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable,coefficient,type
ALW_2A1,0.1,cont
DHHGAGE_cont,0.69,cont
ADL_01,0.56,cat
DPS_04,1.54,cat
variable_five,2,cat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable_five.fun <- function(a, b) {
return(a + b)
}
Loading