Skip to main content
. 2021 Sep 27;23(10):1255. doi: 10.3390/e23101255
Algorithm 1 Diameter-regularized Hessian weighted K-means in vector case
  • Input: Weights vector {w(1),,w(d)}, Hessian matrices {H(1),,H(d)}, diameter regularizer β>0, number of clusters K, iterations T

  • Initialize the K cluster centers {c0(1),,c0(K)} randomly

  • for t=1 to T do

  •   Assignment step:

  •   Initialize Ct(k)= for all k[K].

  •   for j=1 to d do

  •    Assign w(j) to the nearest cluster center, i.e., find kt(j)=argmink[K]w(j)ct1(k)22 and let
    Ct(kt(j))Ct(kt(j)){w(j)} (36)
  •   end for

  •   Update step:

  •   Find current farthest pair of centers (k1,k2)=argmaxk1,k2ct1(k1)ct1(k2)22.

  •   Update ct(k1) and ct(k2) by
    ct(k1)=w(j)Ct(k1)H(j)+βIm1w(j)Ct(k1)H(j)w(j)+βct(k2)ct(k2)=w(j)Ct(k2)H(j)+βIm1w(j)Ct(k2)H(j)w(j)+βct(k1) (37)
  •   for k=1 to K, k{k1,k2} do

  •   Update the cluster centers by
    ct(k)=w(j)Ct(k)H(j)1w(j)Ct(k)H(j)w(j) (38)
  •   end for

  • end for

  • Output: centers {cT(1),,cT(K)} and assignments {CT(1),,CT(K)}.