Skip to main content
. 2022 Apr 23;22(9):3248. doi: 10.3390/s22093248
Algorithm 1. Pseudocode of ReliefF algorithm:
Inputs: Instance set S and the number of classes C
Output: Weight vector w
Step 1: For any feature fa, a = 1, 2, …, d, set the initial weight wa = 0
Step 2: for i = 1 to m do
Randomly select xi from S;
Select the k-nearest neighbors hj from the same class of x;
Select the k-nearest neighbors mj(c) from different class from x
for a = 1 to d do
Update the weight by (9):
w(a)=w(a)j=1kdist(a,xi,hj)mk+cclass(xi){P(c)1P[class(xi)]×j=1kdist[a,xi,mj(c)]}(mk) (9)

End
End