powered by
Given a dataset, compute the cosine similarity between to columns for use in optimization of Dimensional Anchors
cosine(mat)
A symmetrical matrix with as many rows as there are columns in input
A matrix or data.frame
Yann Abraham
David Ruau
implementation by ekstroem (see StackOverflow for details)
data(iris) das <- c('Sepal.Length','Sepal.Width','Petal.Length','Petal.Width') mat <- iris[,das] sim.mat <- cosine(mat) ncol(mat) dim(sim.mat)
Run the code above in your browser using DataLab