code: def test_local_regressor(setup):
      regressor = XGBRegressor(verbosity=1, n_estimators=2)
      regressor.set_params(tree_method="hist")
      regressor.fit(X, y, eval_set=[(X, y)])
      prediction = regressor.predict(X)
  
      assert prediction.ndim == 1
      assert prediction.shape[0] == len(X)
  
      history = regressor.evals_result()
  
      assert isinstance(prediction, mt.Tensor)
      assert isinstance(history, dict)
  
      assert list(history["validation_0"])[0] == "rmse"
      assert len(history["validation_0"]["rmse"]) == 2
  
      # test weight
      weight = mt.random.rand(X.shape[0])
      classifier = XGBRegressor(verbosity=1, n_estimators=2)
      regressor.set_params(tree_method="hist")
      classifier.fit(X, y, sample_weight=weight)
      prediction = classifier.predict(X)
  
      assert prediction.ndim == 1
      assert prediction.shape[0] == len(X)
  
      # test wrong params
      regressor = XGBRegressor(verbosity=1, n_estimators=2)
      with pytest.raises(TypeError):
          regressor.fit(X, y, wrong_param=1)
      regressor.fit(X, y)
      with pytest.raises(TypeError):
          regressor.predict(X, wrong_param=1)
  
imports: import pytest
  from .....None import tensor
  from ..regressor import XGBRegressor
label_desc: Use image node_id 1 for calling a global function with example usage: test_local_regressor(setup) without return types