
Last chance! 50% off unlimited learning
Sale ends in
The version of Shi and Malik first constructs the affinity matrix
scUL(data, k = 2, sigma = 1, ...)
an dist
object of
the number of clusters (default: 2).
bandwidth parameter (default: 1).
extra parameters including
method to perform clustering on embedded data; either "kmeans"
(default) or "GMM"
.
the maximum number of iterations (default: 10).
a named list of S3 class T4cluster
containing
a length-
eigenvalues of the graph laplacian's spectral decomposition.
an
name of the algorithm.
von_luxburg_tutorial_2007T4cluster
# NOT RUN {
# -------------------------------------------------------------
# clustering with 'iris' dataset
# -------------------------------------------------------------
## PREPARE
data(iris)
X = as.matrix(iris[,1:4])
lab = as.integer(as.factor(iris[,5]))
## EMBEDDING WITH PCA
X2d = Rdimtools::do.pca(X, ndim=2)$Y
## CLUSTERING WITH DIFFERENT K VALUES
cl2 = scUL(X, k=2)$cluster
cl3 = scUL(X, k=3)$cluster
cl4 = scUL(X, k=4)$cluster
## VISUALIZATION
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,4), pty="s")
plot(X2d, col=lab, pch=19, main="true label")
plot(X2d, col=cl2, pch=19, main="scUL: k=2")
plot(X2d, col=cl3, pch=19, main="scUL: k=3")
plot(X2d, col=cl4, pch=19, main="scUL: k=4")
par(opar)
# }
Run the code above in your browser using DataLab