From 9f705747f7d8250e20352fa381cbd5ca60578be6 Mon Sep 17 00:00:00 2001 From: Chris Yao Date: Tue, 12 Sep 2017 15:23:58 -0500 Subject: [PATCH] Fixed bugs in FCBF.py and mutual_information.py --- skfeature/function/information_theoretical_based/FCBF.py | 6 +++--- skfeature/utility/mutual_information.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/skfeature/function/information_theoretical_based/FCBF.py b/skfeature/function/information_theoretical_based/FCBF.py index 98d0028..f28737c 100644 --- a/skfeature/function/information_theoretical_based/FCBF.py +++ b/skfeature/function/information_theoretical_based/FCBF.py @@ -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 @@ -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) \ No newline at end of file + return np.array(F, dtype=int), np.array(SU) diff --git a/skfeature/utility/mutual_information.py b/skfeature/utility/mutual_information.py index 919c3ea..98c6908 100644 --- a/skfeature/utility/mutual_information.py +++ b/skfeature/utility/mutual_information.py @@ -1,4 +1,4 @@ -import entropy_estimators as ee +import skfeature.utility.entropy_estimators as ee def information_gain(f1, f2): @@ -63,4 +63,4 @@ def su_calculation(f1, f2): # su(f1,f2) = 2*t1/(t2+t3) su = 2.0*t1/(t2+t3) - return su \ No newline at end of file + return su