Closed mailology closed 3 years ago
I have fixed the following:
k
in the complexity as follows. Both PAM
and naive
give same set of medoids. The order of k
for PAM
is around 0.67 while that of naive
is around 1.7. PAM algorithm
naive algorithm
I have modified the naive algorithm to PAM. The logic of
swap_naive
is changed so that the best and second best distance of each datapoint are cached and used in the computing the cost. When we swap medoid m_k with non-medoid x_i, the cost for datapoint x_j is computed asHence, the complexity of PAM is O(kn^2) . The algorithms are tested on the MNIST-1k data as follows:
Original naive algorithm
PAM algorithm