Skip to main content
. 2021 Apr 13;23(4):457. doi: 10.3390/e23040457
Algorithm 1. Relief algorithm
  • 1:

    Input: Features: F, time of iteration: m

  • 2:

    Initialize weight value of all features to 0, T is the empty set;

  • 3:

    Fori = 1 to m, do

  • 4:

    Obtain a sample Si randomly from the training data set S;

  • 5:

    CalculateSi’s nearest neighbor sample point SiNH from homogeneous training sets, and Si’s nearest neighbor sample point SiNM from Si different kinds of training sets;

  • 6:

    Forj = 1 to a, do

W(Fj)=W(Fj)diff(Fj,SiFj,SiNHFj)/m+diff(Fj,SiFj,SiNMFj)/m (2)
  • 7:

      end for

  • 8:

    end for

  • 9:

    Forj = 1 to a, do

  • 10:

    IfW(Fj)δ

  • 11:

       Add feature Fj to T

  • 12:

    end if

  • 13:

    end for

  • 14:

    Output: selected feature subset T