Eucdist: Computes the Euclidean(square Euclidean) distance matrix

Description Arguments Value Author(s) Examples

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

 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)

qkerntool documentation built on May 2, 2019, 6:11 a.m.