class_docstr: A generic Estimator to train using any algorithm object (with an ``algorithm_arn``).
  
  The Algorithm can be your own, or any Algorithm from AWS
  Marketplace that you have a valid subscription for. This class will perform
  client-side validation on all the inputs.
docstr: Initialize an ``AlgorithmEstimator`` instance.
  
  Args:
      algorithm_arn (str): algorithm arn used for training. Can be just the name if your
          account owns the algorithm.
      role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker
          training jobs and APIsthat create Amazon SageMaker endpoints use this role to
          access training data and model artifacts. After the endpoint
          is created, the inference code might use the IAM role, if it
          needs to access an AWS resource.
      instance_count (int or PipelineVariable): Number of Amazon EC2 instances to use
          for training.
      instance_type (str or PipelineVariable): Type of EC2 instance to use for training,
          for example, 'ml.c4.xlarge'.
      volume_size (int or PipelineVariable): Size in GB of the EBS volume to use for
          storing input data during training (default: 30). Must be large enough to store
          training data if File Mode is used (which is the default).
      volume_kms_key (str or PipelineVariable): Optional. KMS key ID for encrypting
          EBS volume attached to the training instance (default: None).
      max_run (int or PipelineVariable): Timeout in seconds for training
          (default: 24 * 60 * 60).
          After this amount of time Amazon SageMaker terminates the
          job regardless of its current status.
      input_mode (str or PipelineVariable): The input mode that the algorithm supports
          (default: 'File'). Valid modes:
  
          * 'File' - Amazon SageMaker copies the training dataset from
            the S3 location to a local directory.
          * 'Pipe' - Amazon SageMaker streams data directly from S3 to
            the container via a Unix-named pipe.
  
          This argument can be overriden on a per-channel basis using
          ``sagemaker.inputs.TrainingInput.input_mode``.
  
      output_path (str or PipelineVariable): S3 location for saving the training result
          (model artifacts and output files). If not specified,
          results are stored to a default bucket. If
          the bucket with the specific name does not exist, the
          estimator creates the bucket during the
          :meth:`~sagemaker.estimator.EstimatorBase.fit` method
          execution.
      output_kms_key (str or PipelineVariable): Optional. KMS key ID for encrypting the
          training output (default: None). base_job_name (str): Prefix for
          training job name when the
          :meth:`~sagemaker.estimator.EstimatorBase.fit`
          method launches. If not specified, the estimator generates a
          default job name, based on the training image name and
          current timestamp.
      sagemaker_session (sagemaker.session.Session): Session object which manages
          interactions with Amazon SageMaker APIs and any other AWS services needed. If
          not specified, the estimator creates one using the default
          AWS configuration chain.
      tags (Union[Tags]): Tags for
          labeling a training job. For more, see
          https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html.
      subnets (list[str] or list[PipelineVariable]): List of subnet ids. If not specified
          training job will be created without VPC config.
          security_group_ids (list[str]): List of security group ids. If
          not specified training job will be created without VPC config.
      model_uri (str): URI where a pre-trained model is stored, either locally or in S3
          (default: None). If specified, the estimator will create a channel pointing to
          the model so the training job can download it. This model
          can be a 'model.tar.gz' from a previous training job, or
          other artifacts coming from a different source.
          More information:
          https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization
      model_channel_name (str or PipelineVariable): Name of the channel where 'model_uri'
          will be downloaded (default: 'model'). metric_definitions
          (list[dict]): A list of dictionaries that defines the metric(s)
          used to evaluate the training jobs. Each dictionary contains two keys: 'Name' for
          the name of the metric, and 'Regex' for the regular
          expression used to extract the metric from the logs.
      encrypt_inter_container_traffic (bool or PipelineVariable): Specifies whether traffic
          between training containers is encrypted for the training job (default: ``False``).
      use_spot_instances (bool or PipelineVariable): Specifies whether to use SageMaker
          Managed Spot instances for training. If enabled then the
          `max_wait` arg should also be set.
  
          More information:
          https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html
          (default: ``False``).
      max_wait (int or PipelineVariable): Timeout in seconds waiting for spot training
          instances (default: None). After this amount of time Amazon
          SageMaker will stop waiting for Spot instances to become
          available (default: ``None``).
      **kwargs: Additional kwargs. This is unused. It's only added for AlgorithmEstimator
          to ignore the irrelevant arguments.
code: def __init__(
      self,
      algorithm_arn: str,
      role: str = None,
      instance_count: Optional[Union[int, PipelineVariable]] = None,
      instance_type: Optional[Union[str, PipelineVariable]] = None,
      volume_size: Union[int, PipelineVariable] = 30,
      volume_kms_key: Optional[Union[str, PipelineVariable]] = None,
      max_run: Union[int, PipelineVariable] = 24 * 60 * 60,
      input_mode: Union[str, PipelineVariable] = "File",
      output_path: Optional[Union[str, PipelineVariable]] = None,
      output_kms_key: Optional[Union[str, PipelineVariable]] = None,
      base_job_name: Optional[str] = None,
      sagemaker_session: Optional[Session] = None,
      hyperparameters: Optional[
          Dict[str, Union[str, PipelineVariable]]
      ] = None,
      tags: Optional[Tags] = None,
      subnets: Optional[List[Union[str, PipelineVariable]]] = None,
      security_group_ids: Optional[
          List[Union[str, PipelineVariable]]
      ] = None,
      model_uri: Optional[str] = None,
      model_channel_name: Union[str, PipelineVariable] = "model",
      metric_definitions: Optional[
          List[Dict[str, Union[str, PipelineVariable]]]
      ] = None,
      encrypt_inter_container_traffic: Union[
          bool, PipelineVariable
      ] = False,
      use_spot_instances: Union[bool, PipelineVariable] = False,
      max_wait: Optional[Union[int, PipelineVariable]] = None,
      **kwargs,  # pylint: disable=W0613
  ):
      """Initialize an ``AlgorithmEstimator`` instance.
  
      Args:
          algorithm_arn (str): algorithm arn used for training. Can be just the name if your
              account owns the algorithm.
          role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker
              training jobs and APIsthat create Amazon SageMaker endpoints use this role to
              access training data and model artifacts. After the endpoint
              is created, the inference code might use the IAM role, if it
              needs to access an AWS resource.
          instance_count (int or PipelineVariable): Number of Amazon EC2 instances to use
              for training.
          instance_type (str or PipelineVariable): Type of EC2 instance to use for training,
              for example, 'ml.c4.xlarge'.
          volume_size (int or PipelineVariable): Size in GB of the EBS volume to use for
              storing input data during training (default: 30). Must be large enough to store
              training data if File Mode is used (which is the default).
          volume_kms_key (str or PipelineVariable): Optional. KMS key ID for encrypting
              EBS volume attached to the training instance (default: None).
          max_run (int or PipelineVariable): Timeout in seconds for training
              (default: 24 * 60 * 60).
              After this amount of time Amazon SageMaker terminates the
              job regardless of its current status.
          input_mode (str or PipelineVariable): The input mode that the algorithm supports
              (default: 'File'). Valid modes:
  
              * 'File' - Amazon SageMaker copies the training dataset from
                the S3 location to a local directory.
              * 'Pipe' - Amazon SageMaker streams data directly from S3 to
                the container via a Unix-named pipe.
  
              This argument can be overriden on a per-channel basis using
              ``sagemaker.inputs.TrainingInput.input_mode``.
  
          output_path (str or PipelineVariable): S3 location for saving the training result
              (model artifacts and output files). If not specified,
              results are stored to a default bucket. If
              the bucket with the specific name does not exist, the
              estimator creates the bucket during the
              :meth:`~sagemaker.estimator.EstimatorBase.fit` method
              execution.
          output_kms_key (str or PipelineVariable): Optional. KMS key ID for encrypting the
              training output (default: None). base_job_name (str): Prefix for
              training job name when the
              :meth:`~sagemaker.estimator.EstimatorBase.fit`
              method launches. If not specified, the estimator generates a
              default job name, based on the training image name and
              current timestamp.
          sagemaker_session (sagemaker.session.Session): Session object which manages
              interactions with Amazon SageMaker APIs and any other AWS services needed. If
              not specified, the estimator creates one using the default
              AWS configuration chain.
          tags (Union[Tags]): Tags for
              labeling a training job. For more, see
              https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html.
          subnets (list[str] or list[PipelineVariable]): List of subnet ids. If not specified
              training job will be created without VPC config.
              security_group_ids (list[str]): List of security group ids. If
              not specified training job will be created without VPC config.
          model_uri (str): URI where a pre-trained model is stored, either locally or in S3
              (default: None). If specified, the estimator will create a channel pointing to
              the model so the training job can download it. This model
              can be a 'model.tar.gz' from a previous training job, or
              other artifacts coming from a different source.
              More information:
              https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization
          model_channel_name (str or PipelineVariable): Name of the channel where 'model_uri'
              will be downloaded (default: 'model'). metric_definitions
              (list[dict]): A list of dictionaries that defines the metric(s)
              used to evaluate the training jobs. Each dictionary contains two keys: 'Name' for
              the name of the metric, and 'Regex' for the regular
              expression used to extract the metric from the logs.
          encrypt_inter_container_traffic (bool or PipelineVariable): Specifies whether traffic
              between training containers is encrypted for the training job (default: ``False``).
          use_spot_instances (bool or PipelineVariable): Specifies whether to use SageMaker
              Managed Spot instances for training. If enabled then the
              `max_wait` arg should also be set.
  
              More information:
              https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html
              (default: ``False``).
          max_wait (int or PipelineVariable): Timeout in seconds waiting for spot training
              instances (default: None). After this amount of time Amazon
              SageMaker will stop waiting for Spot instances to become
              available (default: ``None``).
          **kwargs: Additional kwargs. This is unused. It's only added for AlgorithmEstimator
              to ignore the irrelevant arguments.
      """
      self.algorithm_arn = algorithm_arn
      super(AlgorithmEstimator, self).__init__(
          role,
          instance_count=instance_count,
          instance_type=instance_type,
          volume_size=volume_size,
          volume_kms_key=volume_kms_key,
          max_run=max_run,
          input_mode=input_mode,
          output_path=output_path,
          output_kms_key=output_kms_key,
          base_job_name=base_job_name,
          sagemaker_session=sagemaker_session,
          tags=format_tags(tags),
          subnets=subnets,
          security_group_ids=security_group_ids,
          model_uri=model_uri,
          model_channel_name=model_channel_name,
          metric_definitions=metric_definitions,
          encrypt_inter_container_traffic=encrypt_inter_container_traffic,
          use_spot_instances=use_spot_instances,
          max_wait=max_wait,
      )
  
      self.algorithm_spec = (
          self.sagemaker_session.sagemaker_client.describe_algorithm(
              AlgorithmName=algorithm_arn
          )
      )
      self.validate_train_spec()
      self.hyperparameter_definitions = self._parse_hyperparameters()
  
      self._hyperparameters = {}
      if hyperparameters:
          self.set_hyperparameters(**hyperparameters)
  
imports: from __future__ import absolute_import
  from typing import Optional, Union, Dict, List
  import sagemaker
  import sagemaker.parameter
  from sagemaker import vpc_utils
  from sagemaker.deserializers import BytesDeserializer
  from sagemaker.deprecations import removed_kwargs
  from sagemaker.estimator import EstimatorBase
  from sagemaker.inputs import TrainingInput, FileSystemInput
  from sagemaker.serializers import IdentitySerializer
  from sagemaker.transformer import Transformer
  from sagemaker.predictor import Predictor
  from sagemaker.session import Session
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.workflow.pipeline_context import runnable_by_pipeline
  from sagemaker.utils import format_tags, Tags
  from sagemaker.workflow import is_pipeline_variable
label_desc: Use image node_id 1 to create a new AlgorithmEstimator object from inherited base classes: EstimatorBase with example: obj = AlgorithmEstimator(algorithm_arn, role, instance_count, instance_type, volume_size, volume_kms_key, max_run, input_mode, output_path, output_kms_key, base_job_name, sagemaker_session, hyperparameters, tags, subnets, security_group_ids, model_uri, model_channel_name, metric_definitions, encrypt_inter_container_traffic, use_spot_instances, max_wait)