Different clustering for different methods

using GeometricClusterAnalysis
using LinearAlgebra
using Plots
using Random

nb_clusters = 14
k = 10
c = 50
iter_max = 100
nstart = 1
nb_means_removed = 10

n = 490
nsignal = n
nnoise = 200
ntimes = 100

dim = 2

sigma = 0.02 .* Matrix(I, dim, dim)
dataset = noisy_fourteen_segments(n, nnoise, sigma, dim)
Data{Float64}(690, 2, [0.4350764975471186 -0.053825421476871166 … -1.1747555650375796 -0.5849725451234553; -0.5698439878521502 0.19136676979255784 … -1.9709027962955528 -0.171822551256537], [6, 2, 8, 1, 8, 9, 1, 8, 2, 13  …  0, 0, 0, 0, 0, 0, 0, 0, 0, 0])

True colors

plot(dataset, aspect_ratio=true, palette = :default, framestyle = :none)

points = dataset.points
2×690 Matrix{Float64}:
  0.435076  -0.0538254  0.516096  0.533439  …  -0.554993  -1.17476  -0.584973
 -0.569844   0.191367   0.817602  0.651487     -0.817789  -1.9709   -0.171823

k-PLM

col_kplm = clustering_kplm( dataset.points, nb_clusters, k, c, nsignal, iter_max, nstart; nb_means_removed = 0)

l = @layout [a b]
p1 = pointset(dataset.points, dataset.colors)
p2 = pointset(dataset.points, col_kplm)
plot(p1, p2, layout = l, legend = false)

mutualinfo(dataset.colors, col_kplm)
0.5997097556172526

k-PDTM

col_kpdtm = clustering_kpdtm(dataset.points, nb_clusters, k, c, nsignal, iter_max, nstart)
l = @layout [a b]
p1 = plot(dataset, aspect_ratio = true, framestyle = :none, markersize = 2)
p2 = pointset(dataset.points, col_kpdtm, legend = false)
plot(p1, p2, layout = l)

mutualinfo(dataset.colors, col_kpdtm)
0.5997097556172526

q-witnessed distance

witnessed_colors = clustering_witnessed(dataset.points, nb_clusters, k, c,
                                        nsignal, iter_max, nstart)
l = @layout [a b]
p1 = plot(dataset, aspect_ratio = true, framestyle = :none, markersize = 2)
p2 = pointset(points, witnessed_colors, legend = :outertopright)
plot(p1, p2, layout = l)

mutualinfo(dataset.colors, witnessed_colors)
0.622947070224565

Power function

buchet_colors = clustering_power_function(dataset.points, nb_clusters, k, c,
                                          nsignal, iter_max, nstart)
l = @layout [a b]
p1 = plot(dataset, aspect_ratio = true, framestyle = :none, markersize = 2)
p2 = pointset(points, buchet_colors)
plot(p1, p2, layout = l, legend = :none)

mutualinfo(dataset.colors, buchet_colors)
0.6301260634205293

DTM filtration

dtm_colors = clustering_dtm_filtration(points, nb_clusters, k, c, nsignal, iter_max, nstart)
l = @layout [a b]
p1 = plot(dataset, aspect_ratio = true, framestyle = :none, markersize = 2)
p2 = pointset(points, dtm_colors)
plot(p1, p2, layout = l, legend = :none)

mutualinfo(dataset.colors, dtm_colors)
0.6308951084488704

ToMaTo

radius = 0.12
tomato_colors = clustering_tomato(points, nb_clusters, k, c, nsignal, radius, iter_max, nstart)
println(mutualinfo(dataset.colors, tomato_colors))
l = @layout [a b]
p1 = plot(dataset, aspect_ratio = true, framestyle = :none, markersize = 2)
p2 = pointset(points, tomato_colors)
plot(p1, p2, layout = l, legend = :none)
Example block output