# 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)
# Get labels for three clusters
labels = clusters(res, 3)
Run the code above in your browser using DataLab