Description Usage Arguments Details Value Author(s) References Examples
View source: R/silhouette_plot.R
It computes the silhouette index for peaks stored in a GRanges object and classified with the cluster_peak method. If the two classifications with a and without alignment are provided, this method computes the index for both these classifications.
1 2 3 | silhouette_plot(object, p = 1,
weight = NULL, alpha = 1,
rescale = FALSE, t.max = 0.5)
|
object |
GRanges object. It must contain the metadata columns associated to the classification to be analyzed.
Specifically it must contain the |
p |
integer value in {0, 1 , 2}. Order of the L^p distance
used. In particular |
weight |
real. Weight w of the distance function (see Details for the definition of the distance function), needed to make the distance between splines and derivatives comparable. It has no Default since it must be the same weight used to define the distance for the classification. |
alpha |
real value between 0 and 1. Value of the convex weight α of the distance to balance the distance between data and derivatives. See details for the definition. Default is 1. |
t.max |
real value. It tunes the maximum shift allowed. In particular the maximum shift at each iteration is computed as max_shift = t.max * range(object) and the optimum registration coefficient will be identified between - max_shift and
+ max_shift. range( |
rescale |
logical. If |
See [Rousseeuw, 1987] for the detailed definition of the index. Specifically, for the peak i it is computed as
s(i) = \frac{a(i)-b(i)}{\max(a(i), b(i))}
with a(i) the average dissimilarity of peak i with all other data within the same cluster and b(i) the lowest average dissimilarity of i to any other cluster, of which i is not a member.
The function returns
the list of the silhouette indeces for the two classifications (if provided in the GRanges object) and for all the choices of the number of clusters
the graphical representation of the silhouette index, varying the number of clusters and the classification. The average silhouette index is also presented.
Alice Parodi, Marco J. Morelli, Laura M. Sangalli, Piercesare Secchi, Simone Vantini
Peter J. Rousseeuw (1987). Silhouettes: a Graphical Aid to the Interpretation and Validation of Cluster Analysis. Computational and Applied Mathematics. 20: 53???65.
1 2 3 4 5 6 7 | # load the data
data(peaks)
# computes the silhouette index and
# shows the graph
sil <- silhouette_plot(peaks.data.cluster, p=2, weight = 1, alpha = 1,
rescale = FALSE, t.max = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.