class_docstr: The analysis object allows analyzing a set of training jobs that belong to
  the same experiment.
class_docstr_tok: ["The","analysis","object","allows","analyzing","a","set","of","training","jobs","that","belong","to","the","same","experiment","."]
docstr: Initializes a new analysis object, using the specified session to make
  requests to AWS and Sagemaker. The initializer already fetches all
  training jobs belonging to the provided experiment.
  
  Args:
      session: The session to interact with AWS services.
      experiment: The name of the experiment to analyze.
      only_completed: Whether to ignore runs which have not completed successfully (a
          warning will be emitted nonetheless).
      include: Whether the training job should be included in the summary. By default, it
          returns True for any job. If `only_completed` is set to True, only completed jobs
          will be passed to this callback.
      resolve_duplicates: Whether to exclude the older experiments if experiments with the
          same hyperparameters are found.
code: def __init__(
      self,
      experiment: str,
      only_completed: bool = True,
      include: Callable[[TrainingJob], bool] = lambda _: True,
      resolve_duplicates: bool = True,
  ):
      """
      Initializes a new analysis object, using the specified session to make
      requests to AWS and Sagemaker. The initializer already fetches all
      training jobs belonging to the provided experiment.
  
      Args:
          session: The session to interact with AWS services.
          experiment: The name of the experiment to analyze.
          only_completed: Whether to ignore runs which have not completed successfully (a
              warning will be emitted nonetheless).
          include: Whether the training job should be included in the summary. By default, it
              returns True for any job. If `only_completed` is set to True, only completed jobs
              will be passed to this callback.
          resolve_duplicates: Whether to exclude the older experiments if experiments with the
              same hyperparameters are found.
      """
      self.experiment_name = experiment
      training_jobs, duplicates = _fetch_training_jobs(
          default_session(),
          self.experiment_name,
          only_completed,
          resolve_duplicates,
      )
      self.duplicates = duplicates
      self.map = {t.name: t for t in training_jobs if include(t)}
      if len(self.map) < len(training_jobs):
          logging.warning(
              " Analysis manually excludes %d jobs",
              len(training_jobs) - len(self.map),
          )
  
imports: from __future__ import annotations
  import datetime
  import json
  import logging
  import re
  import shutil
  import tempfile
  import time
  from collections import Counter
  from functools import cached_property, lru_cache
  from pathlib import Path
  from typing import Any, Callable, cast, Dict, Iterator, List, Tuple, Union
  import boto3
  import numpy
  from botocore.exceptions import ClientError
  from .session import default_session
label_desc: Use image node_id 1 to create a new Analysis object  with example: obj = Analysis(experiment, only_completed, include, resolve_duplicates)