add_test_data: Attach test data to DeepPAM model for testing via pec::pec.

Description Usage Arguments Value Author(s)

View source: R/preproc.R

Description

This function modifies the keras model constructed using deeppam() to feature the data it should be tested on. This step is necessary due to the rigorous preprocessing needed for DeepPAM. newdata_str MUST be equivalent to the newdata argument of pec::pec. Internally, the test data is attached via the attributes of the R object.

Usage

1
2
3
4
5
6
7
add_test_data(
  model,
  newdata_str,
  newdata_unstr = list(),
  training_ped,
  formula = ped_status ~ s(tend, k = 9L)
)

Arguments

model

a keras model of additional subclass deeppam which should be evaluated.

newdata_str

the strucured new data for evaluation. A regular data set. newdata_str MUST be identical to the newdata argument used in pec:pec() later on.

newdata_unstr

the unstructured part of the data for evalution. Must match newdata_str.

training_ped

the PED used for training.

formula

the formula used to fit the model. (can be solved via attribute)

Value

the same model as inputted with a modified attribute set. The model can be handed over to pec::pec() only after this step.

Author(s)

Philipp Kopper


pkopper/deeppam documentation built on Jan. 19, 2021, 12:39 a.m.