Skip to content

Commit

Permalink
Fixed bugs in FCBF.py and mutual_information.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Yao committed Sep 12, 2017
1 parent 8efbccb commit 9f70574
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions skfeature/function/information_theoretical_based/FCBF.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def fcbf(X, y, **kwargs):
delta = 0

# t1[:,0] stores index of features, t1[:,1] stores symmetrical uncertainty of features
t1 = np.zeros((n_features, 2))
t1 = np.zeros((n_features, 2), dtypes='object')
for i in range(n_features):
f = X[:, i]
t1[i, 0] = i
Expand All @@ -63,6 +63,6 @@ def fcbf(X, y, **kwargs):
idx = np.transpose(idx)
# delete the feature by using the mask
s_list = s_list[idx]
length = len(s_list)/2
length = len(s_list)//2
s_list = s_list.reshape((length, 2))
return np.array(F, dtype=int), np.array(SU)
return np.array(F, dtype=int), np.array(SU)
4 changes: 2 additions & 2 deletions skfeature/utility/mutual_information.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import entropy_estimators as ee
import skfeature.utility.entropy_estimators as ee


def information_gain(f1, f2):
Expand Down Expand Up @@ -63,4 +63,4 @@ def su_calculation(f1, f2):
# su(f1,f2) = 2*t1/(t2+t3)
su = 2.0*t1/(t2+t3)

return su
return su

0 comments on commit 9f70574

Please sign in to comment.