code: def validation_curve(
      estimator,
      X,
      y,
      param_name,
      param_range,
      cv=None,
      scoring=None,
      n_jobs=1,
      pre_dispatch="all",
      verbose=0,
  ):
      """Validation curve.
  
      .. deprecated:: 0.18
          This module will be removed in 0.20.
          Use :func:`sklearn.model_selection.validation_curve` instead.
  
      Determine training and test scores for varying parameter values.
  
      Compute scores for an estimator with different values of a specified
      parameter. This is similar to grid search with one parameter. However, this
      will also compute training scores and is merely a utility for plotting the
      results.
  
      Read more in the :ref:`User Guide <validation_curve>`.
  
      Parameters
      ----------
      estimator : object type that implements the "fit" and "predict" methods
          An object of that type which 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.
  
      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.
  
          For integer/None inputs, if the estimator is a classifier and ``y`` is
          either binary or multiclass,
          :class:`sklearn.model_selection.StratifiedKFold` is used. In all
          other cases, :class:`sklearn.model_selection.KFold` is used.
  
          Refer :ref:`User Guide <cross_validation>` for the various
          cross-validation strategies that can be used here.
  
      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)``.
  
      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'.
  
      verbose : integer, optional
          Controls the verbosity: the higher, the more messages.
  
      Returns
      -------
      train_scores : array, shape (n_ticks, n_cv_folds)
          Scores on training sets.
  
      test_scores : array, shape (n_ticks, n_cv_folds)
          Scores on test set.
  
      Notes
      -----
      See
      :ref:`examples/model_selection/plot_validation_curve.py
      <sphx_glr_auto_examples_model_selection_plot_validation_curve.py>`
      """
      X, y = indexable(X, y)
      cv = check_cv(cv, X, y, classifier=is_classifier(estimator))
      scorer = check_scoring(estimator, scoring=scoring)
  
      parallel = Parallel(
          n_jobs=n_jobs, pre_dispatch=pre_dispatch, verbose=verbose
      )
      out = parallel(
          delayed(_fit_and_score)(
              estimator,
              X,
              y,
              scorer,
              train,
              test,
              verbose,
              parameters={param_name: v},
              fit_params=None,
              return_train_score=True,
          )
          for train, test in cv
          for v in param_range
      )
  
      out = np.asarray(out)[:, :2]
      n_params = len(param_range)
      n_cv_folds = out.shape[0] // n_params
      out = out.reshape(n_cv_folds, n_params, 2).transpose((2, 1, 0))
  
      return out[0], out[1]
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/learning_curve.py
imports: import warnings
  import numpy
  from .base import is_classifier, clone
  from .cross_validation import check_cv
  from .externals.joblib import Parallel, delayed
  from .cross_validation import _safe_split, _score, _fit_and_score
  from .metrics.scorer import check_scoring
  from .utils import indexable
  from .utils.fixes import astype
label_desc: Use image node_id 4 for calling a global function with example usage: validation_curve(estimator, X, y, param_name, param_range, cv, scoring, n_jobs, pre_dispatch, verbose) and returns: out,  out