diff --git a/doc/source/init.md b/doc/source/init.md index 3e114836..e3914302 100644 --- a/doc/source/init.md +++ b/doc/source/init.md @@ -23,18 +23,12 @@ KmppAlg KmCentralityAlg RandSeedAlg ``` +In practice, we have found that *Kmeans++* is the most effective choice. -For convenience, the package also defines the two wrapper methods that take -the name of the seeding algorithm and the number of clusters and take care of -allocating `iseeds` and applying the proper `SeedingAlgorithm` instance: +For convenience, the package defines the two wrapper functions that accept +the short name of the seeding algorithm and the number of clusters and take +care of allocating `iseeds` and applying the proper `SeedingAlgorithm`: ```@docs initseeds initseeds_by_costs ``` - -In practice, we found that *Kmeans++* is the most effective seeding method. To -simplify its usage we provide: -```@docs -kmpp -kmpp_by_costs -``` diff --git a/src/deprecate.jl b/src/deprecate.jl index cf070776..3e3ce017 100644 --- a/src/deprecate.jl +++ b/src/deprecate.jl @@ -1,2 +1,5 @@ ## Deprecated +# deprecated at 0.13 +@deprecate kmpp(X, k) initseeds(:kmpp, X, k) +@deprecate kmpp_by_costs(costs, k) initseeds_by_costs(:kmpp, costs, k) diff --git a/src/seeding.jl b/src/seeding.jl index 958b11a4..fd00e176 100644 --- a/src/seeding.jl +++ b/src/seeding.jl @@ -201,21 +201,6 @@ function initseeds_by_costs!(iseeds::IntegerVector, alg::KmppAlg, return iseeds end -""" - kmpp(X, k) - -Use *Kmeans++* to choose `k` seeds from the ``d×n`` data matrix `X`. -""" -kmpp(X::AbstractMatrix{<:Real}, k::Int) = initseeds(KmppAlg(), X, k) - -""" - kmpp_by_costs(C, k) - -Use *Kmeans++* to choose `k` seeds based on the ``n×n`` cost matrix `C`. -""" -kmpp_by_costs(costs::AbstractMatrix{<:Real}, k::Int) = initseeds(KmppAlg(), costs, k) - - """ K-medoids initialization based on centrality (`:kmcen`). diff --git a/test/seeding.jl b/test/seeding.jl index 8cd638ca..9d5fac1a 100644 --- a/test/seeding.jl +++ b/test/seeding.jl @@ -81,19 +81,19 @@ end @test min_interdist((Xt')[:, iseeds]) > 20 * md0 Random.seed!(34568) - iseeds = kmpp(X, k) + iseeds = initseeds(:kmpp, X, k) @test length(iseeds) == k @test alldistinct(iseeds) Random.seed!(34568) - iseeds_t = kmpp(Xt', k) + iseeds_t = initseeds(:kmpp, Xt', k) @test iseeds_t == iseeds Random.seed!(34568) - iseeds = kmpp_by_costs(C, k) + iseeds = initseeds_by_costs(:kmpp, C, k) @test length(iseeds) == k @test alldistinct(iseeds) Random.seed!(34568) - iseeds_t = kmpp_by_costs(Ct', k) + iseeds_t = initseeds_by_costs(:kmpp, Ct', k) @test iseeds_t == iseeds end