class_docstr: The ``AlphaSelection`` visualizer requires a "RegressorCV", that is a
  specialized class that performs cross-validated alpha-selection on behalf
  of the model. If the regressor you wish to use doesn't have an associated
  "CV" estimator, or for some reason you would like to specify more control
  over the alpha selection process, then you can use this manual alpha
  selection visualizer, which is essentially a wrapper for
  ``cross_val_score``, fitting a model for each alpha specified.
  
  Parameters
  ----------
  
  estimator : an unfitted Scikit-Learn regressor
      Should be an instance of an unfitted regressor, and specifically one
      whose name doesn't end with "CV". The regressor must support a call to
      ``set_params(alpha=alpha)`` and be fit multiple times. If the
      regressor name ends with "CV" a ``YellowbrickValueError`` is raised.
  
  ax : matplotlib Axes, default: None
      The axes to plot the figure on. If None is passed in the current axes
      will be used (or generated if required).
  
  alphas : ndarray or Series, default: np.logspace(-10, 2, 200)
      An array of alphas to fit each model with
  
  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 in a `(Stratified)KFold`,
      - An object to be used as a cross-validation generator.
      - An iterable yielding train, test splits.
  
      This argument is passed to the
      ``sklearn.model_selection.cross_val_score`` method to produce the
      cross validated score for each alpha.
  
  scoring : string, callable or None, optional, default: None
      A string (see model evaluation documentation) or
      a scorer callable object / function with signature
      ``scorer(estimator, X, y)``.
  
      This argument is passed to the
      ``sklearn.model_selection.cross_val_score`` method to produce the
      cross validated score for each alpha.
  
  kwargs : dict
      Keyword arguments that are passed to the base class and may influence
      the visualization as defined in other Visualizers.
  
  Examples
  --------
  
  >>> from yellowbrick.regressor import ManualAlphaSelection
  >>> from sklearn.linear_model import Ridge
  >>> model = ManualAlphaSelection(
  ...     Ridge(), cv=12, scoring='neg_mean_squared_error'
  ... )
  ...
  >>> model.fit(X, y)
  >>> model.show()
  
  Notes
  -----
  
  This class does not take advantage of estimator-specific searching and is
  therefore less optimal and more time consuming than the regular
  "RegressorCV" estimators.
class_docstr_tok: ["The","``","AlphaSelection","``","visualizer","requires","a","``","RegressorCV","''",",","that","is","a","specialized","class","that","performs","cross-validated","alpha-selection","on","behalf","of","the","model",".","If","the","regressor","you","wish","to","use","does","n't","have","an","associated","''","CV","''","estimator",",","or","for","some","reason","you","would","like","to","specify","more","control","over","the","alpha","selection","process",",","then","you","can","use","this","manual","alpha","selection","visualizer",",","which","is","essentially","a","wrapper","for","``","cross_val_score","``",",","fitting","a","model","for","each","alpha","specified",".","Parameters","--","--","--","--","--","estimator",":","an","unfitted","Scikit-Learn","regressor","Should","be","an","instance","of","an","unfitted","regressor",",","and","specifically","one","whose","name","does","n't","end","with","``","CV","''",".","The","regressor","must","support","a","call","to","``","set_params","(","alpha=alpha",")","``","and","be","fit","multiple","times",".","If","the","regressor","name","ends","with","``","CV","''","a","``","YellowbrickValueError","``","is","raised",".","ax",":","matplotlib","Axes",",","default",":","None","The","axes","to","plot","the","figure","on",".","If","None","is","passed","in","the","current","axes","will","be","used","(","or","generated","if","required",")",".","alphas",":","ndarray","or","Series",",","default",":","np.logspace","(","-10",",","2",",","200",")","An","array","of","alphas","to","fit","each","model","with","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","in","a","`","(","Stratified",")","KFold","`",",","-","An","object","to","be","used","as","a","cross-validation","generator",".","-","An","iterable","yielding","train",",","test","splits",".","This","argument","is","passed","to","the","``","sklearn.model_selection.cross_val_score","``","method","to","produce","the","cross","validated","score","for","each","alpha",".","scoring",":","string",",","callable","or","None",",","optional",",","default",":","None","A","string","(","see","model","evaluation","documentation",")","or","a","scorer","callable","object","\/","function","with","signature","``","scorer","(","estimator",",","X",",","y",")","``",".","This","argument","is","passed","to","the","``","sklearn.model_selection.cross_val_score","``","method","to","produce","the","cross","validated","score","for","each","alpha",".","kwargs",":","dict","Keyword","arguments","that","are","passed","to","the","base","class","and","may","influence","the","visualization","as","defined","in","other","Visualizers",".","Examples","--","--","--","--",">",">",">","from","yellowbrick.regressor","import","ManualAlphaSelection",">",">",">","from","sklearn.linear_model","import","Ridge",">",">",">","model","=","ManualAlphaSelection","(","...","Ridge","(",")",",","cv=12",",","scoring='neg_mean_squared_error'","...",")","...",">",">",">","model.fit","(","X",",","y",")",">",">",">","model.show","(",")","Notes","--","--","-","This","class","does","not","take","advantage","of","estimator-specific","searching","and","is","therefore","less","optimal","and","more","time","consuming","than","the","regular","''","RegressorCV","''","estimators","."]
code: def __init__(
      self,
      estimator,
      ax=None,
      alphas=None,
      cv=None,
      scoring=None,
      **kwargs,
  ):
      # Check to make sure this is not a "RegressorCV"
      name = estimator.__class__.__name__
      if name.endswith("CV"):
          raise YellowbrickTypeError(
              (
                  "'{}' is a CV regularization model;"
                  " try AlphaSelection instead."
              ).format(name)
          )
  
      # Call super to initialize the class
      super(AlphaSelection, self).__init__(estimator, ax=ax, **kwargs)
  
      # Set manual alpha selection parameters
      if alphas is not None:
          self.alphas = alphas
      else:
          self.alphas = np.logspace(-10, -2, 200)
      self.errors = None
      self.score_method = partial(
          cross_val_score, cv=cv, scoring=scoring
      )
  
imports: import numpy
  from functools import partial
  from yellowbrick.exceptions import YellowbrickTypeError
  from yellowbrick.exceptions import YellowbrickValueError
  from yellowbrick.regressor.base import RegressionScoreVisualizer
  from sklearn.model_selection import cross_val_score
label_desc: Use image node_id 1 to create a new ManualAlphaSelection object from inherited base classes: AlphaSelection with example: obj = ManualAlphaSelection(estimator, ax, alphas, cv, scoring)