class_docstr: Recursive Feature Elimination, Cross-Validated (RFECV) feature selection.
  
  Selects the best subset of features for the supplied estimator by removing
  0 to N features (where N is the number of features) using recursive
  feature elimination, then selecting the best subset based on the
  cross-validation score of the model. Recursive feature elimination
  eliminates n features from a model by fitting the model multiple times and
  at each step, removing the weakest features, determined by either the
  ``coef_`` or ``feature_importances_`` attribute of the fitted model.
  
  The visualization plots the score relative to each subset and shows trends
  in feature elimination. If the feature elimination CV score is flat, then
  potentially there are not enough features in the model. An ideal curve is
  when the score jumps from low to high as the number of features removed
  increases, then slowly decreases again from the optimal number of
  features.
  
  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.
  
  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.
  
  kwargs : dict
      Keyword arguments that are passed to the base class and may influence
      the visualization as defined in other Visualizers.
  
  Attributes
  ----------
  n_features_ : int
      The number of features in the selected subset
  
  support_ : array of shape [n_features]
      A mask of the selected features
  
  ranking_ : array of shape [n_features]
      The feature ranking, such that ``ranking_[i]`` corresponds to the
      ranked position of feature i. Selected features are assigned rank 1.
  
  cv_scores_ : array of shape [n_subsets_of_features, n_splits]
      The cross-validation scores for each subset of features and splits in
      the cross-validation strategy.
  
  rfe_estimator_ : sklearn.feature_selection.RFE
      A fitted RFE estimator wrapping the original estimator. All estimator
      functions such as ``predict()`` and ``score()`` are passed through to
      this estimator (it rewraps the original model).
  
  n_feature_subsets_ : array of shape [n_subsets_of_features]
      The number of features removed on each iteration of RFE, computed by the
      number of features in the dataset and the step parameter.
  
  Notes
  -----
  This model wraps ``sklearn.feature_selection.RFE`` and not
  ``sklearn.feature_selection.RFECV`` because access to the internals of the
  CV and RFE estimators is required for the visualization. The visualizer
  does take similar arguments, however it does not expose the same internal
  attributes.
  
  Additionally, the RFE model can be accessed via the ``rfe_estimator_``
  attribute. Once fitted, the visualizer acts as a wrapper for this
  estimator and not for the original model passed to the model. This way the
  visualizer model can be used to make predictions.
  
  .. caution:: This visualizer requires a model that has either a ``coef_``
      or ``feature_importances_`` attribute when fitted.
class_docstr_tok: ["Recursive","Feature","Elimination",",","Cross-Validated","(","RFECV",")","feature","selection",".","Selects","the","best","subset","of","features","for","the","supplied","estimator","by","removing","0","to","N","features","(","where","N","is","the","number","of","features",")","using","recursive","feature","elimination",",","then","selecting","the","best","subset","based","on","the","cross-validation","score","of","the","model",".","Recursive","feature","elimination","eliminates","n","features","from","a","model","by","fitting","the","model","multiple","times","and","at","each","step",",","removing","the","weakest","features",",","determined","by","either","the","``","coef_","``","or","``","feature_importances_","``","attribute","of","the","fitted","model",".","The","visualization","plots","the","score","relative","to","each","subset","and","shows","trends","in","feature","elimination",".","If","the","feature","elimination","CV","score","is","flat",",","then","potentially","there","are","not","enough","features","in","the","model",".","An","ideal","curve","is","when","the","score","jumps","from","low","to","high","as","the","number","of","features","removed","increases",",","then","slowly","decreases","again","from","the","optimal","number","of","features",".","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",".","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",".","kwargs",":","dict","Keyword","arguments","that","are","passed","to","the","base","class","and","may","influence","the","visualization","as","defined","in","other","Visualizers",".","Attributes","--","--","--","--","--","n_features_",":","int","The","number","of","features","in","the","selected","subset","support_",":","array","of","shape","[","n_features","]","A","mask","of","the","selected","features","ranking_",":","array","of","shape","[","n_features","]","The","feature","ranking",",","such","that","``","ranking_","[","i","]","``","corresponds","to","the","ranked","position","of","feature","i",".","Selected","features","are","assigned","rank","1.","cv_scores_",":","array","of","shape","[","n_subsets_of_features",",","n_splits","]","The","cross-validation","scores","for","each","subset","of","features","and","splits","in","the","cross-validation","strategy",".","rfe_estimator_",":","sklearn.feature_selection.RFE","A","fitted","RFE","estimator","wrapping","the","original","estimator",".","All","estimator","functions","such","as","``","predict","(",")","``","and","``","score","(",")","``","are","passed","through","to","this","estimator","(","it","rewraps","the","original","model",")",".","n_feature_subsets_",":","array","of","shape","[","n_subsets_of_features","]","The","number","of","features","removed","on","each","iteration","of","RFE",",","computed","by","the","number","of","features","in","the","dataset","and","the","step","parameter",".","Notes","--","--","-","This","model","wraps","``","sklearn.feature_selection.RFE","``","and","not","``","sklearn.feature_selection.RFECV","``","because","access","to","the","internals","of","the","CV","and","RFE","estimators","is","required","for","the","visualization",".","The","visualizer","does","take","similar","arguments",",","however","it","does","not","expose","the","same","internal","attributes",".","Additionally",",","the","RFE","model","can","be","accessed","via","the","``","rfe_estimator_","``","attribute",".","Once","fitted",",","the","visualizer","acts","as","a","wrapper","for","this","estimator","and","not","for","the","original","model","passed","to","the","model",".","This","way","the","visualizer","model","can","be","used","to","make","predictions",".","..","caution",":",":","This","visualizer","requires","a","model","that","has","either","a","``","coef_","``","or","``","feature_importances_","``","attribute","when","fitted","."]
code: def __init__(
      self,
      estimator,
      ax=None,
      step=1,
      groups=None,
      cv=None,
      scoring=None,
      **kwargs,
  ):
      # Initialize the model visualizer
      super(RFECV, self).__init__(estimator, ax=ax, **kwargs)
  
      # Set parameters
      self.step = step
      self.groups = groups
      self.cv = cv
      self.scoring = scoring
  
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 to create a new RFECV object from inherited base classes: ModelVisualizer with example: obj = RFECV(estimator, ax, step, groups, cv, scoring)