Skip to content

Commit d59b682

Browse files
authored
Remove use of old typealiases from StatsBase (#240)
Ref JuliaStats/StatsBase.jl#840
1 parent 82821e8 commit d59b682

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Clustering.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Clustering
1010
using Random
1111

1212
import Base: show
13-
import StatsBase: IntegerVector, RealVector, RealMatrix, counts
13+
import StatsBase: counts
1414

1515
export
1616
# reexport from StatsBase

src/seeding.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct RandSeedAlg <: SeedingAlgorithm end
120120
Initialize `iseeds` with the indices of cluster seeds for the `X` data matrix
121121
using the `alg` seeding algorithm.
122122
"""
123-
function initseeds!(iseeds::IntegerVector, alg::RandSeedAlg, X::AbstractMatrix{<:Real};
123+
function initseeds!(iseeds::AbstractVector{<:Integer}, alg::RandSeedAlg, X::AbstractMatrix{<:Real};
124124
rng::AbstractRNG=Random.GLOBAL_RNG)
125125
check_seeding_args(X, iseeds)
126126
sample!(rng, 1:size(X, 2), iseeds; replace=false)
@@ -137,7 +137,7 @@ Here, `costs[i, j]` is the cost of assigning points ``i`` and ``j``
137137
to the same cluster. One may, for example, use the squared Euclidean distance
138138
between the points as the cost.
139139
"""
140-
function initseeds_by_costs!(iseeds::IntegerVector, alg::RandSeedAlg, X::AbstractMatrix{<:Real}; rng::AbstractRNG=Random.GLOBAL_RNG)
140+
function initseeds_by_costs!(iseeds::AbstractVector{<:Integer}, alg::RandSeedAlg, X::AbstractMatrix{<:Real}; rng::AbstractRNG=Random.GLOBAL_RNG)
141141
check_seeding_args(X, iseeds)
142142
sample!(rng, 1:size(X,2), iseeds; replace=false)
143143
end
@@ -157,7 +157,7 @@ proportional to the minimum cost of assigning it to the existing seeds.
157157
"""
158158
struct KmppAlg <: SeedingAlgorithm end
159159

160-
function initseeds!(iseeds::IntegerVector, alg::KmppAlg,
160+
function initseeds!(iseeds::AbstractVector{<:Integer}, alg::KmppAlg,
161161
X::AbstractMatrix{<:Real},
162162
metric::PreMetric = SqEuclidean();
163163
rng::AbstractRNG=Random.GLOBAL_RNG)
@@ -190,7 +190,7 @@ function initseeds!(iseeds::IntegerVector, alg::KmppAlg,
190190
return iseeds
191191
end
192192

193-
function initseeds_by_costs!(iseeds::IntegerVector, alg::KmppAlg,
193+
function initseeds_by_costs!(iseeds::AbstractVector{<:Integer}, alg::KmppAlg,
194194
costs::AbstractMatrix{<:Real};
195195
rng::AbstractRNG=Random.GLOBAL_RNG)
196196
n = size(costs, 1)
@@ -233,7 +233,7 @@ Choose the ``k`` points with the highest *centrality* as seeds.
233233
"""
234234
struct KmCentralityAlg <: SeedingAlgorithm end
235235

236-
function initseeds_by_costs!(iseeds::IntegerVector, alg::KmCentralityAlg,
236+
function initseeds_by_costs!(iseeds::AbstractVector{<:Integer}, alg::KmCentralityAlg,
237237
costs::AbstractMatrix{<:Real}; kwargs...)
238238

239239
n = size(costs, 1)
@@ -258,6 +258,6 @@ function initseeds_by_costs!(iseeds::IntegerVector, alg::KmCentralityAlg,
258258
return iseeds
259259
end
260260

261-
initseeds!(iseeds::IntegerVector, alg::KmCentralityAlg, X::AbstractMatrix{<:Real},
261+
initseeds!(iseeds::AbstractVector{<:Integer}, alg::KmCentralityAlg, X::AbstractMatrix{<:Real},
262262
metric::PreMetric = SqEuclidean(); kwargs...) =
263263
initseeds_by_costs!(iseeds, alg, pairwise(metric, X, dims=2); kwargs...)

0 commit comments

Comments
 (0)