class_docstr: Visualizes the validation curve for both test and training data for a
  range of values for a single hyperparameter of the model. Adjusting the
  value of a hyperparameter adjusts the complexity of a model. Less complex
  models suffer from increased error due to bias, while more complex models
  suffer from increased error due to variance. By inspecting the training
  and cross-validated test score error, it is possible to estimate a good
  value for a hyperparameter that balances the bias/variance trade-off.
  
  The visualizer evaluates cross-validated training and test scores for the
  different hyperparameters supplied. The curve is plotted so that the
  x-axis is the value of the hyperparameter and the y-axis is the model
  score. This is similar to a grid search with a single hyperparameter.
  
  The cross-validation generator splits the dataset k times, and scores are
  averaged over all k runs for the training and test subsets. The curve
  plots the mean score, and the filled in area suggests the variability of
  cross-validation by plotting one standard deviation above and below the
  mean for each split.
  
  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.
  
  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'.
  
  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.
  
  Attributes
  ----------
  train_scores_ : array, shape (n_ticks, n_cv_folds)
      Scores on training sets.
  
  train_scores_mean_ : array, shape (n_ticks,)
      Mean training data scores for each training split
  
  train_scores_std_ : array, shape (n_ticks,)
      Standard deviation of training data scores for each training split
  
  test_scores_ : array, shape (n_ticks, n_cv_folds)
      Scores on test set.
  
  test_scores_mean_ : array, shape (n_ticks,)
      Mean test data scores for each test split
  
  test_scores_std_ : array, shape (n_ticks,)
      Standard deviation of test data scores for each test split
  
  Examples
  --------
  
  >>> import numpy as np
  >>> from yellowbrick.model_selection import ValidationCurve
  >>> from sklearn.svm import SVC
  >>> pr = np.logspace(-6,-1,5)
  >>> model = ValidationCurve(SVC(), param_name="gamma", param_range=pr)
  >>> model.fit(X, y)
  >>> model.show()
  
  Notes
  -----
  This visualizer is essentially a wrapper for the
  ``sklearn.model_selection.learning_curve utility``, discussed in the
  `validation curves <https://bit.ly/2KlumeB>`__
  documentation.
  
  .. seealso:: The documentation for the
      `learning_curve <https://bit.ly/2Yz9sBB>`__
      function, which this visualizer wraps.
class_docstr_tok: ["Visualizes","the","validation","curve","for","both","test","and","training","data","for","a","range","of","values","for","a","single","hyperparameter","of","the","model",".","Adjusting","the","value","of","a","hyperparameter","adjusts","the","complexity","of","a","model",".","Less","complex","models","suffer","from","increased","error","due","to","bias",",","while","more","complex","models","suffer","from","increased","error","due","to","variance",".","By","inspecting","the","training","and","cross-validated","test","score","error",",","it","is","possible","to","estimate","a","good","value","for","a","hyperparameter","that","balances","the","bias\/variance","trade-off",".","The","visualizer","evaluates","cross-validated","training","and","test","scores","for","the","different","hyperparameters","supplied",".","The","curve","is","plotted","so","that","the","x-axis","is","the","value","of","the","hyperparameter","and","the","y-axis","is","the","model","score",".","This","is","similar","to","a","grid","search","with","a","single","hyperparameter",".","The","cross-validation","generator","splits","the","dataset","k","times",",","and","scores","are","averaged","over","all","k","runs","for","the","training","and","test","subsets",".","The","curve","plots","the","mean","score",",","and","the","filled","in","area","suggests","the","variability","of","cross-validation","by","plotting","one","standard","deviation","above","and","below","the","mean","for","each","split",".","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",".","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","'",".","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",".","Attributes","--","--","--","--","--","train_scores_",":","array",",","shape","(","n_ticks",",","n_cv_folds",")","Scores","on","training","sets",".","train_scores_mean_",":","array",",","shape","(","n_ticks",",",")","Mean","training","data","scores","for","each","training","split","train_scores_std_",":","array",",","shape","(","n_ticks",",",")","Standard","deviation","of","training","data","scores","for","each","training","split","test_scores_",":","array",",","shape","(","n_ticks",",","n_cv_folds",")","Scores","on","test","set",".","test_scores_mean_",":","array",",","shape","(","n_ticks",",",")","Mean","test","data","scores","for","each","test","split","test_scores_std_",":","array",",","shape","(","n_ticks",",",")","Standard","deviation","of","test","data","scores","for","each","test","split","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","yellowbrick.model_selection","import","ValidationCurve",">",">",">","from","sklearn.svm","import","SVC",">",">",">","pr","=","np.logspace","(","-6",",","-1,5",")",">",">",">","model","=","ValidationCurve","(","SVC","(",")",",","param_name=","''","gamma","''",",","param_range=pr",")",">",">",">","model.fit","(","X",",","y",")",">",">",">","model.show","(",")","Notes","--","--","-","This","visualizer","is","essentially","a","wrapper","for","the","``","sklearn.model_selection.learning_curve","utility","``",",","discussed","in","the","`","validation","curves","<","https",":","\/\/bit.ly\/2KlumeB",">","`","__","documentation",".","..","seealso",":",":","The","documentation","for","the","`","learning_curve","<","https",":","\/\/bit.ly\/2Yz9sBB",">","`","__","function",",","which","this","visualizer","wraps","."]
docstr: Renders the training and test curves.
docstr_tok: ["Renders","the","training","and","test","curves","."]
code: def draw(self, **kwargs):
      """
      Renders the training and test curves.
      """
      # Specify the curves to draw and their labels
      labels = ("Training Score", "Cross Validation Score")
      curves = (
          (self.train_scores_mean_, self.train_scores_std_),
          (self.test_scores_mean_, self.test_scores_std_),
      )
  
      # Get the colors for the train and test curves
      colors = resolve_colors(n_colors=2)
  
      # Plot the fill betweens first so they are behind the curves.
      for idx, (mean, std) in enumerate(curves):
          # Plot one standard deviation above and below the mean
          self.ax.fill_between(
              self.param_range,
              mean - std,
              mean + std,
              alpha=0.25,
              color=colors[idx],
          )
  
      # Plot the mean curves so they are in front of the variance fill
      for idx, (mean, _) in enumerate(curves):
          self.ax.plot(
              self.param_range,
              mean,
              self.markers,
              color=colors[idx],
              label=labels[idx],
          )
  
      if self.logx:
          self.ax.set_xscale("log")
  
      return self.ax
  
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 3 for calling the ValidationCurve obj's underlying member method code with example usage: obj.draw() and returns: self