class_docstr: Record of the Scheduler completion event. This will have information only available
  after the optimization has completed.
code: def from_scheduler(
      cls, scheduler: Scheduler
  ) -> SchedulerCompletedRecord:
      try:
          model_bridge = get_fitted_model_bridge(scheduler)
          model_fit_dict = model_bridge.compute_model_fit_metrics(
              experiment=scheduler.experiment
          )
          # We'd ideally log the entire `model_fit_dict` as a single model fit metric
          # can't capture the nuances of multiple experimental metrics, but this might
          # lead to database performance issues. So instead, we take the worst
          # coefficient of determination as model fit quality and store the full data
          # in Manifold (TODO).
          model_fit_quality = min(
              model_fit_dict["coefficient_of_determination"].values()
          )
          # similar for uncertainty quantification, but distance from 1 matters
          std = list(
              model_fit_dict["std_of_the_standardized_error"].values()
          )
          model_std_quality = _model_std_quality(np.array(std))
  
      except Exception as e:
          warn(
              "Encountered exception in computing model fit quality: "
              + str(e)
          )
          model_fit_quality = float("-inf")
          model_std_quality = float("-inf")
  
      try:
          improvement_over_baseline = (
              scheduler.get_improvement_over_baseline()
          )
      except Exception as e:
          warn(
              "Encountered exception in computing improvement over baseline: "
              + str(e)
          )
          improvement_over_baseline = float("-inf")
  
      return cls(
          experiment_completed_record=ExperimentCompletedRecord.from_experiment(
              experiment=scheduler.experiment
          ),
          best_point_quality=float("-inf"),  # TODO[T147907632]
          model_fit_quality=model_fit_quality,
          model_std_quality=model_std_quality,
          model_fit_generalization=float(
              "-inf"
          ),  # TODO by cross_validate_by_trial
          model_std_generalization=float("-inf"),
          improvement_over_baseline=improvement_over_baseline,
          num_metric_fetch_e_encountered=scheduler._num_metric_fetch_e_encountered,
          num_trials_bad_due_to_err=scheduler._num_trials_bad_due_to_err,
      )
  
file_path: Ax/ax/telemetry/scheduler.py
imports: from __future__ import annotations
  from dataclasses import asdict, dataclass
  from typing import Any, Dict, Optional
  from warnings import warn
  import numpy
  from ax.service.scheduler import get_fitted_model_bridge, Scheduler
  from ax.telemetry.common import _get_max_transformed_dimensionality
  from ax.telemetry.experiment import ExperimentCompletedRecord, ExperimentCreatedRecord
  from ax.telemetry.generation_strategy import GenerationStrategyCreatedRecord
label_desc: Use image node_id 1 for calling the SchedulerCompletedRecord obj's underlying member method code with example usage: obj.from_scheduler(cls, scheduler) and returns: cls