code: def test_local_classifier_from_to_parquet(setup):
      n_rows = 1000
      n_columns = 10
      rs = np.random.RandomState(0)
      X = rs.rand(n_rows, n_columns)
      y = rs.rand(n_rows)
      df = pd.DataFrame(X, columns=[f"c{i}" for i in range(n_columns)])
      df["id"] = [f"i{i}" for i in range(n_rows)]
  
      booster = xgboost.train(
          {}, xgboost.DMatrix(X, y), num_boost_round=2
      )
  
      with tempfile.TemporaryDirectory() as d:
          m_name = os.path.join(d, "c.model")
          result_dir = os.path.join(d, "result")
          os.mkdir(result_dir)
          data_dir = os.path.join(d, "data")
          os.mkdir(data_dir)
  
          booster.save_model(m_name)
  
          df.iloc[:500].to_parquet(
              os.path.join(d, "data", "data1.parquet")
          )
          df.iloc[500:].to_parquet(
              os.path.join(d, "data", "data2.parquet")
          )
  
          df = md.read_parquet(data_dir).set_index("id")
          model = XGBClassifier()
          model.load_model(m_name)
          result = model.predict(df, run=False)
          r = md.DataFrame(result).to_parquet(result_dir)
  
          # tiles to ensure no iterative tiling exists
          r.execute()
  
          ret = (
              md.read_parquet(result_dir)
              .to_pandas()
              .iloc[:, 0]
              .to_numpy()
          )
          model2 = xgboost.XGBClassifier()
          model2.load_model(m_name)
          expected = model2.predict(X)
          expected = np.stack([1 - expected, expected]).argmax(axis=0)
          np.testing.assert_array_equal(ret, expected)
  
file_path: mars/mars/learn/contrib/xgboost/tests/test_classifier.py
imports: import os
  import tempfile
  import numpy
  import pandas
  import pytest
  from .....None import tensor
  from .....None import dataframe
  from ..classifier import XGBClassifier
label_desc: Use image node_id 2 for calling a global function with example usage: test_local_classifier_from_to_parquet(setup) without return types