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
  
imports: from __future__ import print_function
  from __future__ import division
  import warnings
  import numbers
  import time
  import numpy
  import scipy.sparse
  from ..base import is_classifier, clone
  from ..utils import indexable, check_random_state, safe_indexing
  from ..utils.fixes import astype
  from ..utils.validation import _is_arraylike, _num_samples
  from ..utils.metaestimators import _safe_split
  from ..externals.joblib import Parallel, delayed, logger
  from ..metrics.scorer import check_scoring
  from ..exceptions import FitFailedWarning
  from ._split import check_cv
label_desc: Use image node_id 13 for calling a global function with example usage: _incremental_fit_estimator(estimator, X, y, classes, train, test, train_sizes, scorer, verbose) and returns: np