Eucdist {qkerntool} | R Documentation |
Computes the Euclidean(square Euclidean) distance matrix
Description
Eucdist
Computes the Euclidean(square Euclidean) distance matrix.
Arguments
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. |
Value
E - (MxN) Euclidean (square Euclidean) distances between vectors in x and y
Author(s)
Yusen Zhang
yusenzhang@126.com
Examples
###
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)
[Package qkerntool version 1.19 Index]