Skip to content

Commit af0a12d

Browse files
committed
Adapt BorutaPy to SelectorMixin interface
1 parent 3c9eac3 commit af0a12d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

boruta/boruta_py.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
import numpy as np
1313
import scipy as sp
1414
from sklearn.utils import check_random_state, check_X_y
15-
from sklearn.base import TransformerMixin, BaseEstimator
15+
from sklearn.base import BaseEstimator
16+
from sklearn.feature_selection import SelectorMixin
17+
from sklearn.utils.validation import check_is_fitted
1618
import warnings
1719

1820

19-
class BorutaPy(BaseEstimator, TransformerMixin):
21+
class BorutaPy(BaseEstimator, SelectorMixin):
2022
"""
2123
Improved Python implementation of the Boruta R package.
2224
@@ -452,6 +454,10 @@ def _transform(self, X, weak=False, return_df=False):
452454
X = X[:, indices]
453455
return X
454456

457+
def _get_support_mask(self):
458+
check_is_fitted(self, 'support_')
459+
return self.support_
460+
455461
def _get_tree_num(self, n_feat):
456462
depth = None
457463
try:

0 commit comments

Comments
 (0)