code: def test_lambdarank_parameters(params):
      if params["objective"] == "rank:map":
          rel = 1
      else:
          rel = 4
      X, y, q, w = tm.make_ltr(4096, 3, 13, rel)
      ranker = xgboost.XGBRanker(
          tree_method="hist", n_estimators=64, **params
      )
      ranker.fit(
          X, y, qid=q, sample_weight=w, eval_set=[(X, y)], eval_qid=[q]
      )
      for k, v in ranker.evals_result()["validation_0"].items():
          note(v)
          assert v[-1] >= v[0]
          assert ranker.n_features_in_ == 3
  
imports: import itertools
  import json
  import os
  import shutil
  from typing import Optional
  import numpy
  import pytest
  from hypothesis import given, note, settings
  from scipy.sparse import csr_matrix
  import xgboost
  from xgboost import testing
  from xgboost.testing.data import RelDataCV, simulate_clicks, sort_ltr_samples
  from xgboost.testing.params import lambdarank_parameter_strategy
label_desc: Use image node_id 5 for calling a global function with example usage: test_lambdarank_parameters(params) without return types