7
7
8
8
Assign labels to rows of table using the `k`-medoids algorithm.
9
9
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`.
14
14
15
15
Optionally, specify a dictionary of `weights` for each column to
16
16
affect the underlying table distance from TableDistances.jl, and
@@ -74,8 +74,8 @@ function applyfeat(transform::KMedoids, feat, prep)
74
74
medoids = sample (rng, 1 : nobs, k, replace= false )
75
75
76
76
# 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 ))
79
79
80
80
# pre-allocate memory for labels and distances
81
81
labels = fill (0 , nobs)
@@ -89,7 +89,7 @@ function applyfeat(transform::KMedoids, feat, prep)
89
89
_updatelabels! (td, stdfeat, medoids, labels, dists)
90
90
_updatemedoids! (td, stdfeat, medoids, labels)
91
91
92
- # average dissimilarity
92
+ # average distance to medoids
93
93
δnew = mean (dists)
94
94
95
95
# break upon convergence
0 commit comments