class_docstr: Fetch results about a hyperparameter tuning job and make them accessible for analytics.
docstr: Return a pandas dataframe with all the training jobs.
  
  This includes their hyperparameters, results, and metadata, as well as
  a column to indicate if a training job was the best seen so far.
docstr_tok: ["Return","a","pandas","dataframe","with","all","the","training","jobs",".","This","includes","their","hyperparameters",",","results",",","and","metadata",",","as","well","as","a","column","to","indicate","if","a","training","job","was","the","best","seen","so","far","."]
code: def _fetch_dataframe(self):
      """Return a pandas dataframe with all the training jobs.
  
      This includes their hyperparameters, results, and metadata, as well as
      a column to indicate if a training job was the best seen so far.
      """
  
      def reshape(training_summary):
          # Helper method to reshape a single training job summary into a dataframe record
          out = {}
          for k, v in training_summary["TunedHyperParameters"].items():
              # Something (bokeh?) gets confused with ints so convert to float
              try:
                  v = float(v)
              except (TypeError, ValueError):
                  pass
              out[k] = v
          out["TrainingJobName"] = training_summary["TrainingJobName"]
          out["TrainingJobStatus"] = training_summary[
              "TrainingJobStatus"
          ]
          out["FinalObjectiveValue"] = training_summary.get(
              "FinalHyperParameterTuningJobObjectiveMetric", {}
          ).get("Value")
  
          start_time = training_summary.get("TrainingStartTime", None)
          end_time = training_summary.get("TrainingEndTime", None)
          out["TrainingStartTime"] = start_time
          out["TrainingEndTime"] = end_time
          if start_time and end_time:
              out["TrainingElapsedTimeSeconds"] = (
                  end_time - start_time
              ).total_seconds()
          if "TrainingJobDefinitionName" in training_summary:
              out["TrainingJobDefinitionName"] = training_summary[
                  "TrainingJobDefinitionName"
              ]
          return out
  
      # Run that helper over all the summaries.
      df = pd.DataFrame(
          [reshape(tjs) for tjs in self.training_job_summaries()]
      )
      return df
  
imports: from __future__ import print_function, absolute_import
  from abc import ABCMeta, abstractmethod
  from collections import defaultdict, OrderedDict
  import datetime
  import logging
  from six import with_metaclass
  from sagemaker.session import Session
  from sagemaker.utils import DeferredError
  from sagemaker.lineage import artifact
label_desc: Use image node_id 5 for calling the HyperparameterTuningJobAnalytics obj's underlying member method code with example usage: obj._fetch_dataframe() and returns: df, out