Skip to main content
. 2026 Apr 9;28(4):422. doi: 10.3390/e28040422
Algorithm 1 LDL with Multi-scale Neighborhood Granule
  •   1:

    Input: Feature matrix X, label matrix Y, feature subset F, neighborhood thresholds Θ={θ1,…,θK}

  •   2:

    Output: Multi-scale label distribution matrix D∈Rn×q

  •   3:

    for each scale θk∈Θ do

  •   4:

          for each instance xi∈X do

  •   5:

                Compute neighborhood granule NFθk(xi)={xh∣ΔF(xi,xh)≤θk}

  •   6:

                for each label lj∈Y do

  •   7:

                      Compute label distinguishability Di,jθk by (8)

  •   8:

                      Compute Shannon entropy Hi,jθk by (9)

  •   9:

                end for

  • 10:

          end for

  • 11:

          Compute average neighborhood entropy: Hθk=1nq∑i=1n∑j=1qHi,jθk

  • 12:

    end for

  • 13:

    Compute scale weight: wθk=exp(−Hθk)∑r=1Kexp(−Hθr)

  • 14:

    for each instance xi and label lj do

  • 15:

          Fuse multi-scale label distribution: Di,j=∑k=1KwθkDi,jθk

  • 16:

    end for

  • 17:

    row-wise normalization: Di,j=Di,j∑j=1qDi,j,j=1,2,…,q

  • 18:

    Return: Multi-scale label distribution matrix D