code: def test_fit_metric(self):
      auto_est = AutoEstimator.from_torch(
          model_creator=model_creator,
          optimizer=get_optimizer,
          loss="BCELoss",
          logs_dir="/tmp/zoo_automl_logs",
          resources_per_trial={"cpu": 2},
          name="test_fit",
      )
  
      data, validation_data = get_train_val_data()
  
      def f075(y_true, y_pred):
          from sklearn.metrics import fbeta_score
  
          y_true = np.squeeze(y_true)
          y_pred = np.squeeze(y_pred)
          if np.any(y_pred != y_pred.astype(int)):
              # y_pred is probability
              if y_pred.ndim == 1:
                  y_pred = np.where(y_pred > 0.5, 1, 0)
              else:
                  y_pred = np.argmax(y_pred, axis=1)
          return fbeta_score(y_true, y_pred, beta=0.75)
  
      with pytest.raises(RuntimeError) as exeinfo:
          auto_est.fit(
              data=data,
              validation_data=validation_data,
              search_space=create_linear_search_space(),
              n_sampling=2,
              epochs=1,
              metric=f075,
          )
      assert "metric_mode" in str(exeinfo)
  
      auto_est.fit(
          data=data,
          validation_data=validation_data,
          search_space=create_linear_search_space(),
          n_sampling=2,
          epochs=1,
          metric=f075,
          metric_mode="max",
      )
      assert auto_est.get_best_model()
  
imports: import os
  from unittest import TestCase
  import numpy
  import pytest
  import torch
  import torch.nn
  from torch.utils.data import Dataset, DataLoader
  from bigdl.orca.automl.auto_estimator import AutoEstimator
  from bigdl.orca.automl.pytorch_utils import LR_NAME
  from bigdl.orca.automl import hp
label_desc: Use image node_id 10 for calling the TestPyTorchAutoEstimator obj's underlying member method code with example usage: obj.test_fit_metric() and returns: fbeta_score