cnfm computes the confusion matrix of the clustering with
respect to an expert/reference labeling of the data. Also, it can be used
to compare the labelings of two different clusterings of the same
trajectory, (see details).
1 2 3 4 5 6 7 8 9 10 11 12 13
cnfm(obj, ref, ...) ## S4 method for signature 'binClst,numeric' cnfm(obj, ref, ret = FALSE, ...) ## S4 method for signature 'binClstPath,missing' cnfm(obj, ref, ret = FALSE, ...) ## S4 method for signature 'binClstStck,missing' cnfm(obj, ref, ret = FALSE, ...) ## S4 method for signature 'binClst,binClst' cnfm(obj, ref, ret = FALSE, ...)
A binClst_instance or
A numeric vector with an expert/reference labeling of the data.
A second binClst_instance (see details).
A boolean value (defaults to FALSE). If ret=TRUE the confusion matrix is returned as a matrix object.
The confusion matrix yields marginal counts and Recall for each row, and marginal counts, Precision and class F-measure for each column. The 3x2 subset of cells at the bottom right show (in this order): the overall Accuracy, the average Recall, the average Precision, NaN, NaN, and the overall Macro-F-Measure. The number of classes (expert/reference labeling) should match or, at least not be greater than the number of clusters. The overall value of the Macro-F-Measure is an average of the class F-measure values, hence it is underestimated if the number of classes is lower than the number of clusters.
obj is a binClstPath_instance and there is a column "lbl" in
the [email protected] slot with an expert labeling, this labeling will be used by
obj is a
binClstStck instance and, for all paths in the
stack, there is a column "lbl" in the [email protected] slot of each, this labeling
will be used to compute the confusion matrix for the whole stack.
ref are both a binClst_instance (e.g.
smoothed versus non-smoothed), the confusion matrix compares both labelings.
If ret=TRUE returns a matrix with the confusion matrix values.
1 2 3 4 5 6 7 8 9 10
# -- apply EMbC to the example path -- mybcp <- stbc(expth,info=-1) # -- compute the confusion matrix -- cnfm(mybcp,expth$lbl) # -- as we have expth$lbl the following also works -- cnfm(mybcp,mybcp@pth$lbl) # -- or simply -- cnfm(mybcp) # -- numerical differences with respect to the smoothed clustering -- cnfm(mybcp,smth(mybcp))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.