several modifs - pkg looks better (but untested)
[valse.git] / pkg / tests / testthat / helper-clustering.R
diff --git a/pkg/tests/testthat/helper-clustering.R b/pkg/tests/testthat/helper-clustering.R
deleted file mode 100644 (file)
index 785b7f0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# Compute the sum of (normalized) sum of squares of closest distances to a medoid.
-computeDistortion <- function(series, medoids)
-{
-       n <- ncol(series)
-       L <- nrow(series)
-       distortion <- 0.
-       for (i in seq_len(n))
-               distortion <- distortion + min( colSums( sweep(medoids,1,series[,i],'-')^2 ) / L )
-
-       sqrt( distortion / n )
-}