This is the inference module for subtype definition based on a vector.
After training, we can predict subtype very easily in new data based on
the data frame produced by training trainSubtypeUni
. If one passes
the visitName to the function then we will define subtype from the baseline
value alone.
predictSubtypeUni(
mxdfin,
subtypeDataFrame,
idvar,
visitName,
baselineVisit,
rename = TRUE
)
Input data frame
data frame defining the subtypes and cutpoints
variable name for unique subject identifier column
the column name defining the visit variables
the string naming the baseline visit
boolean will rename levels to user-provided names
data frame with attached subtypess
mydf = generateSubtyperData( 100 )
rbfnames = names(mydf)[grep("Random",names(mydf))]
mydf = outlierness( mydf, rbfnames )
#> [1] "r update: 2"
#> [1] "r update: 3"
#> [1] "r update: 4"
#> [1] "r update: 5"
#> [1] "r update: 6"
#> [1] "r update: 7"
#> [1] "r update: 8"
#> [1] "r update: 9"
mydf = highestQualityRepeat( mydf, "Id", "visit", "OL_KNN_SUM")
qdf = trainSubtypeUni( mydf, "cognition", c("C0","C1","C2"), c(0.33,0.66) )
pdf = predictSubtypeUni( mydf, qdf, "Id" )