diff --git a/test/clustering_quality.jl b/test/clustering_quality.jl index 11cff1c1..dc5ec2a4 100644 --- a/test/clustering_quality.jl +++ b/test/clustering_quality.jl @@ -60,7 +60,14 @@ using Clustering, Distances @test clustering_quality(Y', C', W; quality_index = :xie_beni, fuzziness = 2, metric = Euclidean()) ≈ 1/3 @test clustering_quality(Y', C', W2; quality_index = :xie_beni, fuzziness = 2, metric = Euclidean()) ≈ (14+sqrt(17)) / (12 * 4) - @test clustering_quality(Y', A; quality_index = :dunn, metric = Euclidean()) ≈ 1/2 + @test clustering_quality(Y', A; quality_index = :silhouettes, metric = Euclidean()) ≈ + 1 - 1/12*( # average over silhouettes 1 - a_i * 1/b_i + + 4 * 16 /(3+2sqrt(17)+5) # 4 points in clusters 1 and 3 + + 4 * (2sqrt(2)+2)/3 * 1/4 # 4 points in clusters 2 and 4, top + bottom + + 2 * (2sqrt(2)+2)/3 * 4/(4+2sqrt(26)+6) # 2 points clusters 2 and 4, left and right + + 2 * (2sqrt(2)+2)/3 * 4/(2+2sqrt(10)+4) # 2 points clusters 2 and 4, center + ) + end @testset "alternate arguments" begin