Skip to main content
. 2023 Oct 15;23(20):8477. doi: 10.3390/s23208477
Algorithm 3: Calculating the distances among the feature vectors within a digit class
Assume that Fm = (f1 f2 fS) is a feature matrix for mth class and m = 1,2, ,O and S is the number of the examples in a given class.
  • S1: Calculate the centroid of the class m as:

    Fcm=1Ss=1Sfs

  • S2: Calculate the Euclidean distance between each example and centroid vectors as:

    Lmc=||fmFcm||