Compute Similarity Graph Weighted by Class Structure
Source:R/class_graph.R
discriminating_similarity.RdThis 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.
Arguments
- X
A numeric matrix or data frame containing the data points.
- k
An integer representing the number of nearest neighbors to consider.
- 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.