Skip to content

Commit e04d1a1

Browse files
author
simontamayo
authored
numpy type aliases replaced by builtin types (#102)
1 parent f2f1e3c commit e04d1a1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

boruta/boruta_py.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,12 @@ def _fit(self, X, y):
316316
# 0 - default state = tentative in original code
317317
# 1 - accepted in original code
318318
# -1 - rejected in original code
319-
dec_reg = np.zeros(n_feat, dtype=np.int)
319+
dec_reg = np.zeros(n_feat, dtype=int)
320320
# counts how many times a given feature was more important than
321321
# the best of the shadow features
322-
hit_reg = np.zeros(n_feat, dtype=np.int)
322+
hit_reg = np.zeros(n_feat, dtype=int)
323323
# these record the history of the iterations
324-
imp_history = np.zeros(n_feat, dtype=np.float)
324+
imp_history = np.zeros(n_feat, dtype=float)
325325
sha_max_history = []
326326

327327
# set n_estimators
@@ -393,13 +393,13 @@ def _fit(self, X, y):
393393

394394
# basic result variables
395395
self.n_features_ = confirmed.shape[0]
396-
self.support_ = np.zeros(n_feat, dtype=np.bool)
396+
self.support_ = np.zeros(n_feat, dtype=bool)
397397
self.support_[confirmed] = 1
398-
self.support_weak_ = np.zeros(n_feat, dtype=np.bool)
398+
self.support_weak_ = np.zeros(n_feat, dtype=bool)
399399
self.support_weak_[tentative] = 1
400400

401401
# ranking, confirmed variables are rank 1
402-
self.ranking_ = np.ones(n_feat, dtype=np.int)
402+
self.ranking_ = np.ones(n_feat, dtype=int)
403403
# tentative variables are rank 2
404404
self.ranking_[tentative] = 2
405405
# selected = confirmed and tentative
@@ -425,7 +425,7 @@ def _fit(self, X, y):
425425
self.ranking_[not_selected] = ranks
426426
else:
427427
# all are selected, thus we set feature supports to True
428-
self.support_ = np.ones(n_feat, dtype=np.bool)
428+
self.support_ = np.ones(n_feat, dtype=bool)
429429

430430
self.importance_history_ = imp_history
431431

0 commit comments

Comments
 (0)