code: def rfecv(
      estimator,
      X,
      y,
      ax=None,
      step=1,
      groups=None,
      cv=None,
      scoring=None,
      show=True,
      **kwargs,
  ):
      """
      Performs recursive feature elimination with cross-validation to determine
      an optimal number of features for a model. Visualizes the feature subsets
      with respect to the cross-validation score.
  
      This helper function is a quick wrapper to utilize the RFECV visualizer
      for one-off analysis.
  
      Parameters
      ----------
      estimator : a scikit-learn estimator
          An object that implements ``fit`` and provides information about the
          relative importance of features with either a ``coef_`` or
          ``feature_importances_`` attribute.
  
          Note that the object is cloned for each validation.
  
      X : array-like, shape (n_samples, n_features)
          Training vector, where n_samples is the number of samples and
          n_features is the number of features.
  
      y : array-like, shape (n_samples) or (n_samples, n_features), optional
          Target relative to X for classification or regression.
  
      ax : matplotlib.Axes object, optional
          The axes object to plot the figure on.
  
      step : int or float, optional (default=1)
          If greater than or equal to 1, then step corresponds to the (integer)
          number of features to remove at each iteration. If within (0.0, 1.0),
          then step corresponds to the percentage (rounded down) of features to
          remove at each iteration.
  
      groups : array-like, with shape (n_samples,), optional
          Group labels for the samples used while splitting the dataset into
          train/test set.
  
      cv : int, cross-validation generator or an iterable, optional
          Determines the cross-validation splitting strategy.
          Possible inputs for cv are:
  
            - None, to use the default 3-fold cross-validation,
            - integer, to specify the number of folds.
            - An object to be used as a cross-validation generator.
            - An iterable yielding train/test splits.
  
          see the scikit-learn
          `cross-validation guide <http://scikit-learn.org/stable/modules/cross_validation.html>`_
          for more information on the possible strategies that can be used here.
  
      scoring : string, callable or None, optional, default: None
          A string or scorer callable object / function with signature
          ``scorer(estimator, X, y)``. See scikit-learn model evaluation
          documentation for names of possible metrics.
  
      show: bool, default: True
          If True, calls ``show()``, which in turn calls ``plt.show()`` however you cannot
          call ``plt.savefig`` from this signature, nor ``clear_figure``. If False, simply
          calls ``finalize()``
  
      kwargs : dict
          Keyword arguments that are passed to the base class and may influence
          the visualization as defined in other Visualizers. These arguments are
          also passed to the `show()` method, e.g. can pass a path to save the
          figure to.
  
      Returns
      -------
      viz : RFECV
          Returns the fitted, finalized visualizer.
      """
      # Initialize the visualizer
      oz = RFECV(
          estimator,
          ax=ax,
          step=step,
          groups=groups,
          cv=cv,
          scoring=scoring,
          show=show,
      )
  
      # Fit and show the visualizer
      oz.fit(X, y)
  
      if show:
          oz.show()
      else:
          oz.finalize()
  
      # Return the visualizer object
      return oz
  
file_path: yellowbrick/yellowbrick/model_selection/rfecv.py
imports: import numpy
  from yellowbrick.base import ModelVisualizer
  from yellowbrick.exceptions import YellowbrickValueError
  from sklearn.utils import check_X_y
  from sklearn.feature_selection import RFE
  from sklearn.model_selection import cross_val_score
label_desc: Use image node_id 1 for calling a global function with example usage: rfecv(estimator, X, y, ax, step, groups, cv, scoring, show) and returns: oz