写在前面:
之所以有这篇博文,是因为之前实验的时候很想用RELIEF特征选择,但是苦苦寻找却没有python版的,所以就随手写了一个。(这里仅仅是RELIEF,也就是针对两类问题的)废话不多说,稍微简单介绍一下RELIEF。
RELIEF[edit]
Take a data set with n instances of p features, belonging to two known classes. Within the data set, each feature should be scaled to the interval [0 1] (binary data should remain as 0 and 1). The algorithm will be repeated m times. Start with a p-long weight vector (W) of zeros.
At each iteration, take the feature vector (X) belonging to one random instance, and the feature vectors of the instance closest to X (by Euclidean distance) from each class. The closest same-class instance is called 'near-hit', and the clo