View source: R/compare_model.R
compare_model | R Documentation |
Compares or evaluates model estimated change point set against another model or ground truth. The comparison is made using common metrics to compare clusters. The metrics provided are
"hausdorff": Hausdorff Distance metric;
"rand": Rand Index ;
"symdiff": Symmetric difference metric;
"jaccard": Jaccard similarity index.
compare_model(model1, model2, ncol = NULL)
model1 |
The first blockcpd object or list of sorted integers representing the change point set. |
model2 |
The second blockcpd object or list of sorted integers representing the change point set. |
ncol |
The number of variables which the model was fitted on. Only needs to be passed if both arguments are change point sets instead of a blockcpd object. |
Returns a list containing four metrics:
"haus" Hausdorff distance;
"rand" Rand index;
"symdiff" Symmetric difference;
"jaccard" Jaccard index.
model1 = fit_blockcpd(c(0, 1, 0, 1), lambda = 0) model2 = fit_blockcpd(c(0, 1, 0, 1), lambda = Inf) comparison = compare_model(model1, model2) # change-point sets can also be passed directly with ncol compare_model(c(1,2,3,4), c(3), 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.