Skip to content

Commit

Permalink
numpy type aliases replaced by builtin types (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
simontamayo authored Sep 23, 2021
1 parent f2f1e3c commit e04d1a1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions boruta/boruta_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ def _fit(self, X, y):
# 0 - default state = tentative in original code
# 1 - accepted in original code
# -1 - rejected in original code
dec_reg = np.zeros(n_feat, dtype=np.int)
dec_reg = np.zeros(n_feat, dtype=int)
# counts how many times a given feature was more important than
# the best of the shadow features
hit_reg = np.zeros(n_feat, dtype=np.int)
hit_reg = np.zeros(n_feat, dtype=int)
# these record the history of the iterations
imp_history = np.zeros(n_feat, dtype=np.float)
imp_history = np.zeros(n_feat, dtype=float)
sha_max_history = []

# set n_estimators
Expand Down Expand Up @@ -393,13 +393,13 @@ def _fit(self, X, y):

# basic result variables
self.n_features_ = confirmed.shape[0]
self.support_ = np.zeros(n_feat, dtype=np.bool)
self.support_ = np.zeros(n_feat, dtype=bool)
self.support_[confirmed] = 1
self.support_weak_ = np.zeros(n_feat, dtype=np.bool)
self.support_weak_ = np.zeros(n_feat, dtype=bool)
self.support_weak_[tentative] = 1

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

self.importance_history_ = imp_history

Expand Down

0 comments on commit e04d1a1

Please sign in to comment.