class_docstr: Testing the best point utilities functionality that is not tested in
  main `AxClient` testing suite (`TestServiceAPI`).
class_docstr_tok: ["Testing","the","best","point","utilities","functionality","that","is","not","tested","in","main","`","AxClient","`","testing","suite","(","`","TestServiceAPI","`",")","."]
code: def test_best_from_model_prediction(self) -> None:
      exp = get_branin_experiment()
  
      for _ in range(3):
          sobol = Models.SOBOL(search_space=exp.search_space)
          generator_run = sobol.gen(n=1)
          trial = exp.new_trial(generator_run=generator_run)
          trial.run()
          trial.mark_completed()
          exp.attach_data(exp.fetch_data())
  
      model = Models.BOTORCH_MODULAR(
          experiment=exp, data=exp.lookup_data()
      )
      generator_run = model.gen(n=1)
      trial = exp.new_trial(generator_run=generator_run)
      trial.run()
      trial.mark_completed()
  
      with patch.object(
          TorchModelBridge,
          "model_best_point",
          return_value=(
              (
                  Arm(
                      name="0_0",
                      parameters={
                          "x1": -4.842811906710267,
                          "x2": 11.887089014053345,
                      },
                  ),
                  (
                      {"branin": 34.76260622783635},
                      {"branin": {"branin": 0.00028306433439807734}},
                  ),
              )
          ),
      ) as mock_model_best_point, self.assertLogs(
          logger=best_point_logger, level="WARN"
      ) as lg:
          # Test bad model fit causes function to resort back to raw data
          with patch(
              "ax.service.utils.best_point.assess_model_fit",
              return_value=AssessModelFitResult(
                  good_fit_metrics_to_fisher_score={},
                  bad_fit_metrics_to_fisher_score={
                      "branin": 0,
                  },
              ),
          ):
              self.assertIsNotNone(get_best_parameters(exp, Models))
              self.assertTrue(
                  any(
                      "Model fit is poor" in warning
                      for warning in lg.output
                  ),
                  msg=lg.output,
              )
              mock_model_best_point.assert_not_called()
  
          # Test model best point is used when fit is good
          with patch(
              "ax.service.utils.best_point.assess_model_fit",
              return_value=AssessModelFitResult(
                  good_fit_metrics_to_fisher_score={
                      "branin": 0,
                  },
                  bad_fit_metrics_to_fisher_score={},
              ),
          ):
              self.assertIsNotNone(get_best_parameters(exp, Models))
              mock_model_best_point.assert_called()
  
      # Assert the non-mocked method works correctly as well
      self.assertIsNotNone(get_best_parameters(exp, Models))
  
imports: import random
  from typing import List
  from unittest.mock import MagicMock, patch
  import pandas
  import torch
  from ax.core.arm import Arm
  from ax.core.batch_trial import BatchTrial
  from ax.core.data import Data
  from ax.core.generator_run import GeneratorRun
  from ax.core.objective import ScalarizedObjective
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.outcome_constraint import OutcomeConstraint
  from ax.core.types import ComparisonOp
  from ax.exceptions.core import UserInputError
  from ax.modelbridge.cross_validation import AssessModelFitResult
  from ax.modelbridge.registry import Models
  from ax.modelbridge.torch import TorchModelBridge
  from ax.plot.pareto_utils import get_tensor_converter_model
  from ax.service.utils.best_point import _derel_opt_config_wrapper, _is_row_feasible, extract_Y_from_data, get_best_parameters, get_best_raw_objective_point, logger
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import not_none
  from ax.utils.testing.core_stubs import get_branin_experiment, get_branin_metric, get_experiment_with_observations, get_sobol
  from ax.utils.testing.mock import fast_botorch_optimize
label_desc: Use image node_id 1 for calling the TestBestPointUtils obj's underlying member method code with example usage: obj.test_best_from_model_prediction() without return types