Optional data.frame for which to compute the model predictions. If omitted, the model training data is used.
Cluster trajectory predictions are made when ids are not specified.
strategy
A function returning the cluster index based on the given vector of membership probabilities.
By default (strategy = which.max), trajectories are assigned to the most likely cluster.
...
Additional arguments.
Value
A factor of length nrow(newdata) that indicates the assigned cluster per trajectory per observation.
Details
The default implementation uses predictPostprob to determine the cluster membership.
# NOT RUN {data(latrendData)
model <- latrend(method = lcMethodKML("Y", id = "Id", time = "Time"), latrendData)
predictAssignments(model, newdata = data.frame(Id = 999, Y = 0, Time = 0))
# }