code: def test_warm_start_clear(GradientBoosting, X, y):
      # Test if fit clears state.
      gb_1 = GradientBoosting(n_iter_no_change=5, random_state=42)
      gb_1.fit(X, y)
  
      gb_2 = GradientBoosting(
          n_iter_no_change=5, random_state=42, warm_start=True
      )
      gb_2.fit(X, y)  # inits state
      gb_2.set_params(warm_start=False)
      gb_2.fit(X, y)  # clears old state and equals est
  
      # Check that both predictors have the same train_score_ and
      # validation_score_ attributes
      assert_allclose(gb_1.train_score_, gb_2.train_score_)
      assert_allclose(gb_1.validation_score_, gb_2.validation_score_)
  
      # Check that both predictors are equal
      _assert_predictor_equal(gb_1, gb_2, X)
  
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 7 for calling a global function with example usage: test_warm_start_clear(GradientBoosting, X, y) without return types