powered by
Given a dataset, compute the cosine similarity between to columns for use in optimization of Dimensional Anchors
cosine(mat)
A matrix or data.frame
A symmetrical matrix with as many rows as there are columns in input
implementation by ekstroem (see StackOverflow for details)
# NOT RUN { 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