Description Arguments Value Author(s) Examples
Eucdist
Computes the Euclidean(square Euclidean) distance matrix.
x |
(NxD) matrix (N samples, D features) |
y |
(MxD) matrix (M samples, D features) |
sEuclidean |
can be TRUE or FALSE, FALSE to Compute the Euclidean distance matrix. |
E - (MxN) Euclidean (square Euclidean) distances between vectors in x and y
Yusen Zhang
yusenzhang@126.com
1 2 3 4 5 6 7 8 9 10 11 12 13 | ###
data(iris)
testset <- sample(1:150,20)
x <- as.matrix(iris[-testset,-5])
y <- as.matrix(iris[testset,-5])
##
res0 <- Eucdist(x)
res1 <- Eucdist(x, x, sEuclidean = FALSE)
res2 <- Eucdist(x, y = NULL, sEuclidean = FALSE)
res3 <- Eucdist(x, x, sEuclidean = TRUE)
res4 <- Eucdist(x, y = NULL)
res5 <- Eucdist(x, sEuclidean = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.