class_docstr: Managed optimization loop, in which Ax oversees deployment of trials and
  gathering data.
class_docstr_tok: ["Managed","optimization","loop",",","in","which","Ax","oversees","deployment","of","trials","and","gathering","data","."]
docstr: Obtains the best point encountered in the course
  of this optimization.
docstr_tok: ["Obtains","the","best","point","encountered","in","the","course","of","this","optimization","."]
code: def get_best_point(
      self,
  ) -> Tuple[TParameterization, Optional[TModelPredictArm]]:
      """Obtains the best point encountered in the course
      of this optimization."""
      # Find latest trial which has a generator_run attached and get its predictions
      model_predictions = get_best_parameters_from_model_predictions(
          experiment=self.experiment, models_enum=Models
      )
      if model_predictions is not None:
          return model_predictions
  
      # Could not find through model, default to using raw objective.
      parameterization, values = get_best_raw_objective_point(
          experiment=self.experiment
      )
      # For values, grab just the means to conform to TModelPredictArm format.
      return (
          parameterization,
          (
              {k: v[0] for k, v in values.items()},  # v[0] is mean
              {
                  k: {k: v[1] * v[1]} for k, v in values.items()
              },  # v[1] is sem
          ),
      )
  
imports: from __future__ import annotations
  import inspect
  import logging
  from typing import Iterable, List, Optional, Tuple
  from ax.core.arm import Arm
  from ax.core.base_trial import BaseTrial
  from ax.core.batch_trial import BatchTrial
  from ax.core.experiment import Experiment
  from ax.core.formatting_utils import data_and_evaluations_from_raw_data
  from ax.core.trial import Trial
  from ax.core.types import TEvaluationFunction, TEvaluationOutcome, TModelPredictArm, TParameterization
  from ax.core.utils import get_pending_observation_features
  from ax.exceptions.constants import CHOLESKY_ERROR_ANNOTATION
  from ax.exceptions.core import SearchSpaceExhausted, UserInputError
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.dispatch_utils import choose_generation_strategy
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.modelbridge.registry import Models
  from ax.service.utils.best_point import get_best_parameters_from_model_predictions, get_best_raw_objective_point
  from ax.service.utils.instantiation import InstantiationBase, TParameterRepresentation
  from ax.utils.common.executils import retry_on_exception
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 9 for calling the OptimizationLoop obj's underlying member method code with example usage: obj.get_best_point() and returns: parameterization,  unknown,  unknown, model_predictions