Description Usage Arguments Value Author(s)
This function transforms PED data (from pammtools) to an array or tensor
for further usage in tensorflow.
The array is constructed from the PED so that the first dimension has same
length as there are unique IDs in the PED. The second dimension reflects all
distinct intervals per ID and the third dimension features all model features
effectively used by the PAM(M).
The third axis features the offset ([, , 1]
) all linear covariates and
all spline covariates in a already transformed manner using mgcv::gam for
the transformation.
The transformation is based on the formula argument.
1 2 3 4 5 6 7 | from_ped_to_tensor(
ped,
formula = ped_status ~ s(tend, k = 9L, bs = "cr"),
training = TRUE,
training_data = NULL,
id = "id"
)
|
ped |
a PED (see pammtools) data frame. |
formula |
a formula for a PAM(M) (see pammtools/mgcv) |
training |
a boolean indicating if a training or test set is to be constructed. |
training_data |
only relevant if training == TRUE. The training PED that has been used to fit the model is to be tested. |
id |
a string indicating the name of the ID variable. |
A list of class ped_tensor and length 2.
[[1]]
is the associated input (X) and [[2]]
the associated target (y).
Philipp Kopper
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.