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

    Input: Features: F, time of iteration: m, the number of features: a

  • 2:

    Initialize the weight value W corresponding to all features to 0 and T to the empty set;

  • 3:

    fori = 1 to m, do

  • 4:

    Obtain the sample point Si randomly from the training data set S1,S2,S3Sn;

  • 5:

    Calculate k nearest neighbor samples SiNHh(h=1,2k) from the training data set of the same type as Si; calculate the k nearest neighbor samples SiNMh(h=1,2k) from each training data set different from Si;

  • 6:

    Forj = 1 to a, do

Equation (5),

  • 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