| diss_cosine | R Documentation |
Creates a configuration object for computing cosine dissimilarity
(also known as spectral angle mapper). Pass the result to
dissimilarity() to compute the dissimilarity matrix.
The cosine dissimilarity between two observations x_i and
x_j is:
c(x_i, x_j) = \cos^{-1}
\frac{\sum_{k=1}^{p} x_{i,k}\, x_{j,k}}
{\sqrt{\sum_{k=1}^{p} x_{i,k}^{2}}\,
\sqrt{\sum_{k=1}^{p} x_{j,k}^{2}}}
where p is the number of variables.
diss_cosine(center = TRUE, scale = FALSE)
center |
Logical. Center the data before computing dissimilarities?
Applied jointly to |
scale |
Logical. Scale the data before computing dissimilarities?
Applied jointly to |
An object of class c("diss_cosine", "diss_method").
dissimilarity, diss_euclidean,
diss_mahalanobis
m <- diss_cosine()
m <- diss_cosine(center = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.