code: def test_evaluate_and_optimise_classification():
      """Test evaluate_and_optimise method of Optimiser class."""
      reader = Reader(sep=",")
  
      dict = reader.train_test_split(
          Lpath=["data_for_tests/train.csv", "data_for_tests/test.csv"],
          target_name="Survived",
      )
      drift_thresholder = Drift_thresholder()
      drift_thresholder = drift_thresholder.fit_transform(dict)
  
      with pytest.warns(UserWarning) as record:
          opt = Optimiser(scoring="accuracy", n_folds=3)
      assert len(record) == 1
      dict_error = dict.copy()
      dict_error["target"] = dict_error["target"].astype(str)
      with pytest.raises(ValueError):
          score = opt.evaluate(None, dict_error)
  
      with pytest.warns(UserWarning) as record:
          opt = Optimiser(scoring="accuracy", n_folds=3)
      assert len(record) == 1
      score = opt.evaluate(None, dict)
      assert 0.0 <= score <= 1.0
  
      space = {
          "ne__numerical_strategy": {"search": "choice", "space": [0]},
          "ce__strategy": {
              "search": "choice",
              "space": ["label_encoding"],
          },
          "fs__threshold": {"search": "uniform", "space": [0.01, 0.3]},
          "est__max_depth": {
              "search": "choice",
              "space": [3, 4, 5, 6, 7],
          },
      }
  
      best = opt.optimise(space, dict, 1)
      assert type(best) == type(dict)
  
file_path: MLBox/tests/test_optimiser.py
imports: import pytest
  import numpy
  from mlbox.optimisation.optimiser import Optimiser
  from mlbox.preprocessing.drift_thresholder import Drift_thresholder
  from mlbox.preprocessing.reader import Reader
  from mlbox.optimisation import make_scorer
label_desc: Use image node_id 6 for calling a global function with example usage: test_evaluate_and_optimise_classification() without return types