powered by
Returns an n by n similarity matrix.
wise_sim(data, measure = "distance", metric = "manhattan", k = NULL)
an n by n similarity matrix.
an n by p data matrix, with n being the sample size and p being the dimension.
the similarity measure: "distance" for distance-based measure; "graph" for k-nearest neighbor graph-based measure. The default is "distance".
character string specifying the distance metric or graph weight. "manhattan" for Manhattan distance (default), "euclidean" for Euclidean distance.
the Number of nearest neighbors used in k-nearest neighbor graph. k = floor(sqrt(n)) if not specified.
X <- matrix(rnorm(100), nrow = 10) wise_sim(X, measure = "distance", metric = "manhattan")
Run the code above in your browser using DataLab