class_docstr: Base class for BoostRFA meta-estimator.
  
  Warning: This class should not be used directly. Use derived classes
  instead.
class_docstr_tok: ["Base","class","for","BoostRFA","meta-estimator",".","Warning",":","This","class","should","not","be","used","directly",".","Use","derived","classes","instead","."]
docstr: Private method to reduce the input X to the features selected.
docstr_tok: ["Private","method","to","reduce","the","input","X","to","the","features","selected","."]
code: def _transform(self, X, inverse=False):
      """Private method to reduce the input X to the features selected."""
  
      shapes = np.shape(X)
      if len(shapes) != 2:
          raise ValueError("X must be 2D.")
  
      if shapes[1] != self.support_.shape[0]:
          raise ValueError(
              "Expected {} features, received {}.".format(
                  self.support_.shape[0], shapes[1]
              )
          )
  
      if inverse:
          if isinstance(X, np.ndarray):
              return X[:, self._support]
          elif hasattr(X, "loc"):
              return X.loc[:, self._support]
          elif sp.sparse.issparse(X):
              return X[:, self._support]
          else:
              raise ValueError("Data type not understood.")
      else:
          if isinstance(X, np.ndarray):
              return X[:, self.support_]
          elif hasattr(X, "loc"):
              return X.loc[:, self.support_]
          elif sp.sparse.issparse(X):
              return X[:, self.support_]
          else:
              raise ValueError("Data type not understood.")
  
imports: import io
  import contextlib
  import warnings
  import numpy
  import scipy
  from copy import deepcopy
  from sklearn.base import clone
  from sklearn.utils.validation import check_is_fitted
  from sklearn.base import BaseEstimator, TransformerMixin
  from joblib import Parallel, delayed
  from hyperopt import fmin, tpe
  from .utils import ParameterSampler, _check_param, _check_boosting
  from .utils import _set_categorical_indexes, _get_categorical_support
  from .utils import _feature_importances, _shap_importances
label_desc: Use image node_id 5 for calling the _RFA obj's underlying member method code with example usage: obj._transform(X, inverse) and returns: X, X, X, X, X, X