discriminating_simililarity | R Documentation |
This function computes a similarity graph that is weighted by the class structure of the data. It is useful for preserving the local similarity and diversity within the data, making it suitable for tasks like face and handwriting digits recognition.
discriminating_simililarity(
X,
k = length(labels)/2,
sigma,
cg,
threshold = 0.01
)
X |
A numeric matrix or data frame containing the data points. |
k |
An integer representing the number of nearest neighbors to consider. Default is the number of unique labels divided by 2. |
sigma |
A numeric value representing the scaling factor for the heat kernel. |
cg |
A class_graph object computed from the labels. |
threshold |
A numeric value representing the threshold for the class graph. Default is 0.01. |
A weighted similarity graph in the form of a matrix.
Local similarity and diversity preserving discriminant projection for face and handwriting digits recognition
X <- matrix(rnorm(100*100), 100, 100)
labels <- factor(rep(1:5, each=20))
cg <- class_graph(labels)
sigma <- 0.7
W <- discriminating_simililarity(X, k=length(labels)/2, sigma, cg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.