code: def test_warm_start_early_stopping(GradientBoosting, X, y, scoring):
      # Make sure that early stopping occurs after a small number of iterations
      # when fitting a second time with warm starting.
  
      n_iter_no_change = 5
      gb = GradientBoosting(
          n_iter_no_change=n_iter_no_change,
          max_iter=10000,
          early_stopping=True,
          random_state=42,
          warm_start=True,
          tol=1e-3,
          scoring=scoring,
      )
      gb.fit(X, y)
      n_iter_first_fit = gb.n_iter_
      gb.fit(X, y)
      n_iter_second_fit = gb.n_iter_
      assert 0 < n_iter_second_fit - n_iter_first_fit < n_iter_no_change
  
file_path: scikit-learn/sklearn/ensemble/_hist_gradient_boosting/tests/test_warm_start.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from sklearn.base import clone
  from sklearn.datasets import make_classification, make_regression
  from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor
  from sklearn.metrics import check_scoring
label_desc: Use image node_id 5 for calling a global function with example usage: test_warm_start_early_stopping(GradientBoosting, X, y, scoring) without return types