@@ -518,13 +518,13 @@ def fit(self, X, y, **fit_params):
518518
519519 # holds the decision about each feature:
520520 # default (0); accepted (1); rejected (-1)
521- dec_reg = np .zeros (n_features , dtype = np . int )
522- dec_history = np .zeros ((self .max_iter , n_features ), dtype = np . int )
521+ dec_reg = np .zeros (n_features , dtype = int )
522+ dec_history = np .zeros ((self .max_iter , n_features ), dtype = int )
523523 # counts how many times a given feature was more important than
524524 # the best of the shadow features
525- hit_reg = np .zeros (n_features , dtype = np . int )
525+ hit_reg = np .zeros (n_features , dtype = int )
526526 # record the history of the iterations
527- imp_history = np .zeros (n_features , dtype = np . float )
527+ imp_history = np .zeros (n_features , dtype = float )
528528 sha_max_history = []
529529
530530 for i in range (self .max_iter ):
@@ -587,8 +587,8 @@ def fit(self, X, y, **fit_params):
587587 confirmed = np .where (dec_reg == 1 )[0 ]
588588 tentative = np .where (dec_reg == 0 )[0 ]
589589
590- self .support_ = np .zeros (n_features , dtype = np . bool )
591- self .ranking_ = np .ones (n_features , dtype = np . int ) * 4
590+ self .support_ = np .zeros (n_features , dtype = bool )
591+ self .ranking_ = np .ones (n_features , dtype = int ) * 4
592592 self .n_features_ = confirmed .shape [0 ]
593593 self .importance_history_ = imp_history [1 :]
594594
@@ -733,8 +733,8 @@ def fit(self, X, y, **fit_params):
733733 if step <= 0 :
734734 raise ValueError ("Step must be >0." )
735735
736- self .support_ = np .ones (n_features , dtype = np . bool )
737- self .ranking_ = np .ones (n_features , dtype = np . int )
736+ self .support_ = np .ones (n_features , dtype = bool )
737+ self .ranking_ = np .ones (n_features , dtype = int )
738738 if scoring :
739739 self .score_history_ = []
740740 eval_score = np .max if self .greater_is_better else np .min
@@ -918,10 +918,10 @@ def fit(self, X, y, **fit_params):
918918 if step <= 0 :
919919 raise ValueError ("Step must be >0." )
920920
921- self .support_ = np .zeros (n_features , dtype = np . bool )
922- self ._support = np .ones (n_features , dtype = np . bool )
923- self .ranking_ = np .ones (n_features , dtype = np . int )
924- self ._ranking = np .ones (n_features , dtype = np . int )
921+ self .support_ = np .zeros (n_features , dtype = bool )
922+ self ._support = np .ones (n_features , dtype = bool )
923+ self .ranking_ = np .ones (n_features , dtype = int )
924+ self ._ranking = np .ones (n_features , dtype = int )
925925 if scoring :
926926 self .score_history_ = []
927927 eval_score = np .max if self .greater_is_better else np .min
@@ -992,8 +992,8 @@ def fit(self, X, y, **fit_params):
992992 self .estimator_ = best_estimator
993993
994994 if len (set (self .score_history_ )) == 1 :
995- self .support_ = np .ones (n_features , dtype = np . bool )
996- self .ranking_ = np .ones (n_features , dtype = np . int )
995+ self .support_ = np .ones (n_features , dtype = bool )
996+ self .ranking_ = np .ones (n_features , dtype = int )
997997 self .estimator_ = all_features_estimator
998998 self .n_features_ = self .support_ .sum ()
999999
0 commit comments