# NOT RUN {
# comparing a model to the ground truth using the adjusted Rand index
data(latrendData)
model <- latrend(lcMethodKML(), data = latrendData, response = "Y")
# extract the reference class from the Class column
trajLabels <- aggregate(Class ~ Id, head, 1, data = latrendData)
trajLabels$Cluster <- trajLabels$Class
refModel <- lcModelPartition(latrendData, response = "Y", trajectoryAssignments = trajLabels)
externalMetric(model, refModel, 'adjustedRand') # 0.76
# }
Run the code above in your browser using DataLab