plot.cvxclust | R Documentation |
Plot a clusterpath for two-dimensional data.
## S3 method for class 'cvxclust'
plot(x, col = NULL, labels = NULL, ...)
x |
A |
col |
A vector containing cluster membership information. Default is
|
labels |
A vector containing labels for each object. Default is
|
... |
Further graphical parameters. |
A plot in the console.
# Load data
data(two_half_moons)
data = as.matrix(two_half_moons)
X = data[, -3]
y = data[, 3]
# Get sparse distances in dictionary of keys format with k = 5 and phi = 8
W = sparse_weights(X, 5, 8.0)
# Set a sequence for lambda
lambdas = seq(0, 2400, 1)
# Compute results CMM
res = convex_clusterpath(X, W, lambdas)
plot(res, y + 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.