Learn R Programming

gputools (version 1.1)

gpuDistClust: Compute Distances and Hierarchical Clustering for Vectors on a GPU

Description

This function takes a set of vectors and performs clustering on them. The function will first calculate the distance between all of the pairs of vectors and then use the distances to cluster the vectors. Both of these steps are done on the GPU.

Usage

gpuDistClust(points, distmethod = "euclidean", clustmethod = "complete")

Arguments

points
a matrix of floating point numbers in which each row is a vector in $R^n$ space where $n$ is ncol(points).
distmethod
a string representing the name of the metric to use to calculate the distance between the vectors of 'points'. Currently supported values are: "binary", "canberra", "euclidean", "manhattan", "maximum".
clustmethod
a string representing the name of the clustering method to be applied to distances. Currently supported method names include "average", "centroid", "complete", "flexible", "flexible group", "mcquitty", "median", "single", "ward", and "wpgma".

Value

type "hclust" with the following attributes.

See Also

gpuDist, gpuHclust.

Examples

Run this code
numVectors <- 5
dimension <- 10
Vectors <- matrix(runif(numVectors*dimension), numVectors, dimension)
myClust <- gpuDistClust(Vectors, "maximum", "mcquitty")
plot(myClust)

Run the code above in your browser using DataLab