code: def validation_curve(
      estimator,
      X,
      y,
      param_name,
      param_range,
      ax=None,
      logx=False,
      groups=None,
      cv=None,
      scoring=None,
      n_jobs=1,
      pre_dispatch="all",
      show=True,
      markers="-d",
      **kwargs,
  ):
      """
      Displays a validation curve for the specified param and values, plotting
      both the train and cross-validated test scores. The validation curve is a
      visual, single-parameter grid search used to tune a model to find the best
      balance between error due to bias and error due to variance.
  
      This helper function is a wrapper to use the ValidationCurve in a fast,
      visual analysis.
  
      Parameters
      ----------
      estimator : a scikit-learn estimator
          An object that implements ``fit`` and ``predict``, can be a
          classifier, regressor, or clusterer so long as there is also a valid
          associated scoring metric.
  
          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;
          None for unsupervised learning.
  
      param_name : string
          Name of the parameter that will be varied.
  
      param_range : array-like, shape (n_values,)
          The values of the parameter that will be evaluated.
  
      ax : matplotlib.Axes object, optional
          The axes object to plot the figure on.
  
      logx : boolean, optional
          If True, plots the x-axis with a logarithmic scale.
  
      groups : array-like, with shape (n_samples,)
          Optional group labels for the samples used while splitting the dataset
          into train/test sets.
  
      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 <https://bit.ly/2MMQAI7>`_
          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.
  
      n_jobs : integer, optional
          Number of jobs to run in parallel (default 1).
  
      pre_dispatch : integer or string, optional
          Number of predispatched jobs for parallel execution (default is
          all). The option can reduce the allocated memory. The string can
          be an expression like '2*n_jobs'.
  
      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()``
  
      markers : string, default: '-d'
          Matplotlib style markers for points on the plot points
          Options: '-,', '-+', '-o', '-*', '-v', '-h', '-d'
  
      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
      -------
      visualizer : ValidationCurve
          The fitted visualizer
      """
  
      # Initialize the visualizer
      oz = ValidationCurve(
          estimator,
          param_name,
          param_range,
          ax=ax,
          logx=logx,
          groups=groups,
          cv=cv,
          scoring=scoring,
          n_jobs=n_jobs,
          pre_dispatch=pre_dispatch,
          markers=markers,
      )
  
      # Fit the visualizer
      oz.fit(X, y)
  
      # Draw final visualization
      if show:
          oz.show(**kwargs)
      else:
          oz.finalize()
  
      # Return the visualizer object
      return oz
  
file_path: yellowbrick/yellowbrick/model_selection/validation_curve.py
imports: import numpy
  from yellowbrick.base import ModelVisualizer
  from yellowbrick.style import resolve_colors
  from yellowbrick.exceptions import YellowbrickValueError
  from sklearn.model_selection import validation_curve
label_desc: Use image node_id 1 for calling a global function with example usage: validation_curve(estimator, X, y, param_name, param_range, ax, logx, groups, cv, scoring, n_jobs, pre_dispatch, show, markers) and returns: oz