class_docstr: Record of the "Optimization" completion event. This can come from either an
  AxClient or a Scheduler. This Record is especially useful for logging Ax-backed
  optimization results to a tabular database (i.e. one row per Record)
class_docstr_tok: ["Record","of","the","``","Optimization","''","completion","event",".","This","can","come","from","either","an","AxClient","or","a","Scheduler",".","This","Record","is","especially","useful","for","logging","Ax-backed","optimization","results","to","a","tabular","database","(","i.e",".","one","row","per","Record",")"]
code: def from_scheduler(
      cls,
      scheduler: Scheduler,
      unique_identifier: str,
      deployed_job_id: Optional[int],
      estimated_early_stopping_savings: float,
      estimated_global_stopping_savings: float,
  ) -> OptimizationCompletedRecord:
      scheduler_completed_record = (
          SchedulerCompletedRecord.from_scheduler(scheduler=scheduler)
      )
      experiment_completed_record = (
          scheduler_completed_record.experiment_completed_record
      )
  
      return cls(
          num_initialization_trials=(
              experiment_completed_record.num_initialization_trials
          ),
          num_bayesopt_trials=experiment_completed_record.num_bayesopt_trials,
          num_other_trials=experiment_completed_record.num_other_trials,
          num_completed_trials=experiment_completed_record.num_completed_trials,
          num_failed_trials=experiment_completed_record.num_failed_trials,
          num_abandoned_trials=experiment_completed_record.num_abandoned_trials,
          num_early_stopped_trials=(
              experiment_completed_record.num_early_stopped_trials
          ),
          total_fit_time=experiment_completed_record.total_fit_time,
          total_gen_time=experiment_completed_record.total_gen_time,
          best_point_quality=scheduler_completed_record.best_point_quality,
          **_extract_model_fit_dict(scheduler_completed_record),
          improvement_over_baseline=(
              scheduler_completed_record.improvement_over_baseline
          ),
          num_metric_fetch_e_encountered=(
              scheduler_completed_record.num_metric_fetch_e_encountered
          ),
          num_trials_bad_due_to_err=(
              scheduler_completed_record.num_trials_bad_due_to_err
          ),
          unique_identifier=unique_identifier,
          deployed_job_id=deployed_job_id,
          estimated_early_stopping_savings=estimated_early_stopping_savings,
          estimated_global_stopping_savings=estimated_global_stopping_savings,
      )
  
file_path: Ax/ax/telemetry/optimization.py
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import Dict, Optional, Union
  from ax.core.experiment import Experiment
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.service.ax_client import AxClient
  from ax.service.scheduler import Scheduler
  from ax.telemetry.ax_client import AxClientCompletedRecord, AxClientCreatedRecord
  from ax.telemetry.common import _get_max_transformed_dimensionality, DEFAULT_PRODUCT_SURFACE, get_unique_identifier
  from ax.telemetry.experiment import ExperimentCreatedRecord
  from ax.telemetry.generation_strategy import GenerationStrategyCreatedRecord
  from ax.telemetry.scheduler import SchedulerCompletedRecord, SchedulerCreatedRecord
label_desc: Use image node_id 1 for calling the OptimizationCompletedRecord obj's underlying member method code with example usage: obj.from_scheduler(cls, scheduler, unique_identifier, deployed_job_id, estimated_early_stopping_savings, estimated_global_stopping_savings) and returns: cls