Skip to content

Commit 8ad1323

Browse files
committed
Minor adjustments
1 parent 260c156 commit 8ad1323

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/transforms/kmedoids.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
88
Assign labels to rows of table using the `k`-medoids algorithm.
99
10-
The iterative algorithm is interrupted if the relative change of
11-
the average dissimilarity between successive iterations is smaller
12-
than a tolerance `tol` or if the number of iterations exceeds
13-
the maximum number of iterations `maxiter`.
10+
The iterative algorithm is interrupted if the relative change on
11+
the average distance to medoids is smaller than a tolerance `tol`
12+
or if the number of iterations exceeds the maximum number of
13+
iterations `maxiter`.
1414
1515
Optionally, specify a dictionary of `weights` for each column to
1616
affect the underlying table distance from TableDistances.jl, and
@@ -74,8 +74,8 @@ function applyfeat(transform::KMedoids, feat, prep)
7474
medoids = sample(rng, 1:nobs, k, replace=false)
7575

7676
# retrieve distance type
77-
row = Tables.subset(stdfeat, 1:1)
78-
D = eltype(pairwise(td, row))
77+
s = Tables.subset(stdfeat, 1:1)
78+
D = eltype(pairwise(td, s))
7979

8080
# pre-allocate memory for labels and distances
8181
labels = fill(0, nobs)
@@ -89,7 +89,7 @@ function applyfeat(transform::KMedoids, feat, prep)
8989
_updatelabels!(td, stdfeat, medoids, labels, dists)
9090
_updatemedoids!(td, stdfeat, medoids, labels)
9191

92-
# average dissimilarity
92+
# average distance to medoids
9393
δnew = mean(dists)
9494

9595
# break upon convergence

0 commit comments

Comments
 (0)