code: def predict_at_point(
      model: ModelBridge,
      obsf: ObservationFeatures,
      metric_names: Set[str],
      scalarized_metric_config: Optional[List[Dict[str, Any]]] = None,
  ) -> Tuple[Dict[str, float], Dict[str, float]]:
      """Make a prediction at a point.
  
      Returns mean and standard deviation in format expected by plotting.
  
      Args:
          model: ModelBridge
          obsf: ObservationFeatures for which to predict
          metric_names: Limit predictions to these metrics.
          scalarized_metric_config: An optional list of dicts specifying how to aggregate
              multiple metrics into a single scalarized metric. For each dict, the key is
              the name of the new scalarized metric, and the value is a dictionary mapping
              each metric to its weight. e.g.
              {"name": "metric1:agg", "weight": {"metric1_c1": 0.5, "metric1_c2": 0.5}}.
  
      Returns:
          A tuple containing
  
          - Map from metric name to prediction.
          - Map from metric name to standard error.
      """
      f_pred, cov_pred = model.predict([obsf])
      mean_pred_dict = {
          metric_name: pred[0] for metric_name, pred in f_pred.items()
      }
      cov_pred_dict = {}
      for metric_name1, pred_dict in cov_pred.items():
          cov_pred_dict[metric_name1] = {}
          for metric_name2, pred in pred_dict.items():
              cov_pred_dict[metric_name1][metric_name2] = pred[0]
  
      y_hat = {}
      se_hat = {}
      for metric_name in f_pred:
          if metric_name in metric_names:
              y_hat[metric_name] = mean_pred_dict[metric_name]
              se_hat[metric_name] = np.sqrt(
                  cov_pred_dict[metric_name][metric_name]
              )
      if scalarized_metric_config is not None:
          for agg_metric in scalarized_metric_config:
              agg_metric_name = agg_metric["name"]
              if agg_metric_name in metric_names:
                  agg_metric_weight_dict = agg_metric["weight"]
                  pred_mean, pred_var = _compute_scalarized_outcome(
                      mean_dict=mean_pred_dict,
                      cov_dict=cov_pred_dict,
                      agg_metric_weight_dict=agg_metric_weight_dict,
                  )
                  y_hat[agg_metric_name] = pred_mean
                  se_hat[agg_metric_name] = np.sqrt(pred_var)
      return y_hat, se_hat
  
file_path: Ax/ax/modelbridge/prediction_utils.py
imports: from __future__ import annotations
  from typing import Any, Dict, List, Optional, Set, Tuple
  import numpy
  from ax.core.observation import ObservationFeatures
  from ax.modelbridge import ModelBridge
label_desc: Use image node_id 1 for calling a global function with example usage: predict_at_point(model, obsf, metric_names, scalarized_metric_config) and returns: y_hat,  se_hat