code: def _incremental_fit_estimator(
      estimator,
      X,
      y,
      classes,
      train,
      test,
      train_sizes,
      scorer,
      verbose,
  ):
      """Train estimator on training subsets incrementally and compute scores."""
      train_scores, test_scores = [], []
      partitions = zip(train_sizes, np.split(train, train_sizes)[:-1])
      for n_train_samples, partial_train in partitions:
          train_subset = train[:n_train_samples]
          X_train, y_train = _safe_split(estimator, X, y, train_subset)
          X_partial_train, y_partial_train = _safe_split(
              estimator, X, y, partial_train
          )
          X_test, y_test = _safe_split(
              estimator, X, y, test, train_subset
          )
          if y_partial_train is None:
              estimator.partial_fit(X_partial_train, classes=classes)
          else:
              estimator.partial_fit(
                  X_partial_train, y_partial_train, classes=classes
              )
          train_scores.append(
              _score(estimator, X_train, y_train, scorer)
          )
          test_scores.append(_score(estimator, X_test, y_test, scorer))
      return np.array((train_scores, test_scores)).T
  
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 3 for calling a global function with example usage: _incremental_fit_estimator(estimator, X, y, classes, train, test, train_sizes, scorer, verbose) and returns: np