88from sklearn .base import clone
99from sklearn .utils .validation import check_is_fitted
1010from sklearn .base import BaseEstimator , TransformerMixin
11- from sklearn .utils .metaestimators import if_delegate_has_method
1211
1312from joblib import Parallel , delayed
1413from hyperopt import fmin , tpe
@@ -241,7 +240,6 @@ def predict(self, X, **predict_params):
241240
242241 return self .estimator_ .predict (X , ** predict_params )
243242
244- @if_delegate_has_method (delegate = 'estimator' )
245243 def predict_proba (self , X , ** predict_params ):
246244 """Predict X probabilities.
247245
@@ -260,6 +258,9 @@ def predict_proba(self, X, **predict_params):
260258
261259 check_is_fitted (self )
262260
261+ # raise original AttributeError
262+ getattr (self .estimator_ , 'predict_proba' )
263+
263264 if hasattr (self , 'transform' ):
264265 X = self .transform (X )
265266
@@ -335,6 +336,31 @@ def transform(self, X):
335336 else :
336337 raise ValueError ("Data type not understood." )
337338
339+ def get_support (self , indices = False ):
340+ """Get a mask, or integer index, of the features selected.
341+
342+ Parameters
343+ ----------
344+ indices : bool, default=False
345+ If True, the return value will be an array of integers, rather
346+ than a boolean mask.
347+
348+ Returns
349+ -------
350+ support : array
351+ An index that selects the retained features from a feature vector.
352+ If `indices` is False, this is a boolean array of shape
353+ [# input features], in which an element is True iff its
354+ corresponding feature is selected for retention. If `indices` is
355+ True, this is an integer array of shape [# output features] whose
356+ values are indices into the input feature vector.
357+ """
358+
359+ check_is_fitted (self )
360+
361+ mask = self .support_
362+ return mask if not indices else np .where (mask )[0 ]
363+
338364
339365class _Boruta (_BoostSelector ):
340366 """Base class for BoostBoruta meta-estimator.
0 commit comments