Skip to content

Commit

Permalink
fixed hamming distance normalization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfrankzhang committed Feb 11, 2021
1 parent 7795389 commit 8a26df1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skrebate/relieff.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def pre_normalize(x):
d_dist = squareform(pdist(xd, metric='hamming'))
# Cityblock is also known as Manhattan distance
c_dist = squareform(pdist(pre_normalize(xc), metric='cityblock'))
return np.add(d_dist, c_dist) / self._num_attributes
return np.add(d_dist * self._num_attributes, c_dist)

else: #continuous features only
#xc = pre_normalize(xc)
Expand Down

0 comments on commit 8a26df1

Please sign in to comment.