gower icon indicating copy to clipboard operation
gower copied to clipboard

fast distance matrix

Open markvanderloo opened this issue 5 years ago • 0 comments

We can do a dist matrix naively as follows:

gower_distmat <- function(x,...){
  i <- seq_len(nrow(x))
  I <- rep(i, each=nrow(x))
  J <- rep(i, times=nrow(x))
  d <- gower_dist(x[I,],x[J,],...)
  as.dist(matrix(d, nrow=nrow(x)))
}

but that's pretty memory-inefficient. Should do this from C level w/o copying.

markvanderloo avatar Sep 27 '18 06:09 markvanderloo